首页 > 代码库 > linux nginx启用php

linux nginx启用php

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