Home > Backend Development > PHP Tutorial > 服务器-Ubuntu安装apache2无法解析php

服务器-Ubuntu安装apache2无法解析php

WBOY
Release: 2016-06-02 11:34:00
Original
1419 people have browsed it

服务器ubuntuphp

我按照http://blog.csdn.net/hitabc141592/article/details/23556079 的安装了apache2 这些
然后建立他里面php,然后访问了,html可以,php无法解析。
尝试了修改apache2.conf在百度到 Ubuntu 无法解析php 的所有方法,最后发现没有用
我自己写了几个php发现也是无法解析,中间有多次重启了apache

<code>sudo /etc/init.d/apache2 restart</code>
Copy after login

另外我好奇
在/etc/apache2/apache2.conf文件中添加下面两行即可:

AddHandler php5-script .php .html

AddType text/html .php .html

保存后重启apache2:

sudo /etc/init.d/apache2 restart
是添加在/etc/apache2/apache2.conf的什么,我尝试了 放在apache2.conf文件最后,放在随意位置,把apache2.conf所有代换为上面代码。没有一个好用。

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template