之前才网上找了好多文章,但是配置总会出错,后来傻傻的发现官方文档都有的,当然配合网上文章说明更好,因此本文只说一个大概
安装PHP
配置用户和用户组,需要有根目录权限
vim /usr/local/etc/php-fpm.conf
Nginx
user www www;
# 需要具有根目录权限 www www 700 /home/www
server {
listen 80;
server_name localhost;
root /home/www;
location / {
index index.php index.html index.htm;
}
location ~ \.php$ {
root /home/www;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}