已安装nginx php的情况下:
nginx -v
php -v
可以不用改nginx php-fpm的user group 使用默认的就好 主要是保证nginx php-fpm都起来了
1、查看nginx:
a、ps aux | grep nginx
如果看到了nginx 27433 0.0 0.1 121192 3596 ? S 14:31 0:00 nginx: worker process 类似的worker进程就证明起来了
b、也可以查看: netstat -ant | grep LISTEN 看是否有80端口
2、查看php-fpm
同上a、ps aux | grep php-fpm
b、netstat -ant | grep LISTEN 看是否有9000端口 [mysql是3306]
修改nginx的配置文件 nginx.conf
如果不知道在哪 可以使用 whereis nginx.conf 或者 find / -name nginx.conf
yum安装的一般在/etc/nginx/nginx.conf
编译安装一般在/usr/local/nginx/nginx.conf
在nginx.conf中的第一个server{
location / {
root html;
index index.php index.html index.htm;
}
location ~* \.php$ {
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
}中添加括号中的代码
重启nginx (kill -HUP nginx[这种表示杀死后自己启动] / killall -9 nginx [这种是杀死还需要自己启动])