Home > Backend Development > PHP Problem > What should I do if html cannot output php code?

What should I do if html cannot output php code?

藏色散人
Release: 2023-03-15 07:16:02
Original
2458 people have browsed it

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. .

What should I do if html cannot output php code?

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>
Copy after login

Problem solution:

Add the following two items to httpd.conf and restart.OK!

AddHandler php5-script .php .html
AddType text/html .php .html
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template