标签:lamp
httpd主配置文件/usr/local/apache2.4/conf/httpd.conf vim /usr/local/apache2.4/conf/httpd.conf //修改以下4个地方
ServerName
Require all denied
AddType application/x-httpd-php .php
DirectoryIndex index.html index.php
具体操作:
1,打开这一行ServerName www.example.com:80
2,Require all denied改为Require all granted
3,AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
在上面两行下面加上这一行,不增加这一行php没办法解析
AddType application/x-httpd-php .php
4,DirectoryIndex index.html改为DirectoryIndex index.html index.php 增加一个索引页
/usr/local/apache2.4/bin/apachectl -t
/usr/local/apache2.4/bin/apachectl start
netstat -lntp
curl localhost
vim /usr/local/apache2.4/htodcs/test.php //增加如下内容
<?php
echo 123;
?>
curl localhost/test.php
标签:lamp
原文地址:http://blog.51cto.com/chenshengsheng/2097368