Home  >  Article  >  Operation and Maintenance  >  How to solve the problem that apache cannot parse php files

How to solve the problem that apache cannot parse php files

王林
王林Original
2020-11-02 15:42:336291browse

The solution to the problem that apache cannot parse php files: first add support for parsing php scripts; then modify the IfModule module to [DirectoryIndex index.html index.htm index.php] and increase the index of php.

How to solve the problem that apache cannot parse php files

The solution is as follows:

(Recommended tutorial: apache)

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的索引

Related recommendations: php training

The above is the detailed content of How to solve the problem that apache cannot parse php files. 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