jins-note

Ubuntu下安装Apache 2无法解析html中的php

Ubuntu下安装了Apache 2却无法解析html中的php ,好多说是在httpd.conf文件中修改代码,但是ubuntu中没有这个文件啊,新建添加代码之后,网页直接把html的代码给显示出来了……

其实一个可行的办法是,在/etc/apache2/apache2.conf文件中添加下面两行即可:

AddHandler php5-script .php .html

AddType text/html .php .html

保存后重启apache2:

sudo /etc/init.d/apache2 restart


 




分类:

技术点:

相关文章:

  • 2021-11-25
  • 2022-01-28
  • 2021-04-21
  • 2022-12-23
  • 2021-10-20
  • 2022-12-23
  • 2021-11-13
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-19
  • 2022-02-08
  • 2021-08-23
  • 2022-12-23
相关资源
相似解决方案