Home  >  Article  >  Backend Development  >  What to do if httpd php does not parse

What to do if httpd php does not parse

藏色散人
藏色散人Original
2020-08-22 09:31:563178browse

The solution to httpd php not parsing: first find "AddType application/x-gzip .gz .tgz"; then add the content as "AddType application/x-httpd-php .php" and save it.

What to do if httpd php does not parse

Recommended: "PHP Video Tutorial"

apache does not parse php

I still don’t understand the parameters of apache well enough.

1. Find:

AddType application/x-gzip .gz .tgz

Add below it:

AddType application/x-httpd-php .php //添加支持对php脚本解析

2. Find:

<IfModule dir_module>
DirectoryIndex index.html
</IfModule>

Change the middle line to:

DirectoryIndex index.html index.htm index.php //增加对php的索引

It’s normal.

In addition, when compiling PHP, you need to call the apache module, --with-apxs2=/usr/local/apache2/bin/apxs

The above is the detailed content of What to do if httpd php does not parse. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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