The solution to the problem that html cannot output php code: 1. Open httpd.conf; 2. Add "AddHandler php5-script .php .html AddType text/html .php .html"; 3. Restart the service. .
The operating environment of this article: Windows7 system, PHP5 version, DELL G3 computer
html What should I do if the php code cannot be output?
html embedded php code cannot be parsed
php and apache are installed, but the browser cannot parse the php code for such code.
<html><body><h1>d</h1> <?php echo "test"; ?> </body></html>
Problem solution:
Add the following two items to httpd.conf and restart.OK!
AddHandler php5-script .php .html AddType text/html .php .html
Recommended study: "PHP Video Tutorial"
The above is the detailed content of What should I do if html cannot output php code?. For more information, please follow other related articles on the PHP Chinese website!