Home > Article > Backend Development > What should I do if the php code inserted into html does not execute?
Solution to the problem of inserting php code into html that does not execute: First open the httpd.conf configuration file; then add content [AddType application/x-httpd-php .php .html] to the file.
Question:
(Recommended tutorial: php graphic tutorial)
Insert php code into the html file, and php does not interpret and execute it after running.
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>测试</title> </head> <body> <h1>hello</h1> <?php $a=array("Dog","Cat","Horse"); print_r($a); ?> </body> </html>
Solution:
(Video tutorial recommendation: php video tutorial)
Open the configuration file httpd.conf and add the following content to the file That’s it.
AddType application/x-httpd-php .php .html
The above is the detailed content of What should I do if the php code inserted into html does not execute?. For more information, please follow other related articles on the PHP Chinese website!