修改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

 

相关文章:

  • 2022-12-23
  • 2022-01-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-18
猜你喜欢
  • 2021-12-26
  • 2021-12-09
  • 2022-12-23
  • 2021-08-07
  • 2022-12-23
  • 2022-01-13
相关资源
相似解决方案