修改Apache的配置文件httpd.conf(vi /etc/httpd/conf/httpd.conf)
DirectoryIndex index.html index.php #添加index.php
找到:
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
添加如下内容
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php .php
检查LoadModule php5_module modules/libphp5.so(/usr/lib64/httpd/modules/libphp5.so)是否已经添加
最后新建index.php进行测试
<?php phpinfo(); ?>
参考:
https://www.cnblogs.com/qiuxiao/p/6815350.html
原文地址:https://www.cnblogs.com/EasonJim/p/9614958.html
时间: 2024-10-18 03:06:34