Apache和PHP结合 Apache默认虚拟主机

摘要:• 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 • /usr/l....

•httpd主配置文件/usr/local/apache2.4/conf/httpd.conf

002UASMrzy7605pjKJv15&690.jpg

•vim/usr/local/apache2.4/conf/httpd.conf//修改以下4个地方

ServerName

Requirealldenied

AddTypeapplication/x-httpd-php.php

DirectoryIndexindex.htmlindex.php

•/usr/local/apache2.4/bin/apachectl-t//测试语法

•/usr/local/apache2.4/bin/apachectlstart//启动服务

•netstat-lntp

•curllocalhost

•vim/usr/local/apache2.4/htodcs/test.php//增加如下内容

<?php

echo123;

?>

•curllocalhost/test.php