1. 程式人生 > >linux nginx啟用php

linux nginx啟用php

filename etc 註釋 rip sha arp clu logs div

cd /usr/local/php/etc

mv php-fpm.conf.default php-fpm.conf

vi /usr/local/nginx/conf/nginx.conf

# 刪除如下部分的註釋,保存退出,

location ~ \.php$ {

    root           html;

    fastcgi_pass   127.0.0.1:9000;

    fastcgi_index  index.php;

    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;//由於我本地的網站代碼放在/web目錄下,故這裏需要調整

    include        fastcgi_params;

}

# 啟動 php-fpm 和 nginx
/usr/local/php/sbin/php-fpm
/usr/local/nginx/sbin/nginx

  

linux nginx啟用php