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