Apache和PHP结合设置

胖胖不是两三天

温馨提示:这篇文章已超过713天没有更新,请注意相关的内容是否还可用!

/usr/local/httpd/conf/httpd.conf这个是阿豪安装的apache目录

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

# vi /usr/local/httpd/conf/httpd.conf

更改

ServerName 改为ServerName localhost:80

Require all denied 改成Require all granted

DirectoryIndex index.html index.php

//使apache支持php

# echo "AddType application/x-httpd-php .php" >> /usr/local/httpd/conf/httpd.conf

验证是否正确# /usr/local/httpd/bin/apachectl -t

# /usr/local/httpd/bin/apachectl graceful   重新加载配置文件

测试# vi /usr/local/httpd/htdocs/test.php  添加内容

<?php echo 123;?>

image.png

<?php phpinfo();?>   这个是php探针

文章版权声明:除非注明,否则均为阿豪运维笔记原创文章,转载或复制请以超链接形式并注明出处。