php cannot be parsed in html

藏色散人
Release: 2023-02-26 17:02:01
Original
5231 people have browsed it

php cannot be parsed in html

#php cannot be parsed in html?

Phenomena:

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

Solution:

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

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

Note: If it is php7, change the php5-script in the first line to php7-script.

For more PHP related knowledge, please visit PHP Chinese website!

The above is the detailed content of php cannot be parsed in html. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
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