nginx
yum install -y nginx
service nginx restart
php-fpm
yum install -y php-fpm
service php-fpm restart
nginx配置
location ~\.php$ {
root /data/www/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
php-fpm配置
系统关闭enforce
# 不关闭的话,会在日志中出现permission denied,而命名文件是有的,就是无法访问。
setenforce 0
- 一般不需要修改,直接启动即可
联合测试
<?php
phpinfo();
?>