>  기사  >  백엔드 개발  >  nginx 配备php环境

nginx 配备php环境

WBOY
WBOY원래의
2016-06-13 12:43:32889검색

nginx 配置php环境:
nginx 配置php环境:

安装php php-fpm

cp /etc/php.ini /usr/local/php5.3.22/lib/

修改:/usr/local/php5.3.22/etc/php-fpm.conf

user = nobody

group = nobody

启动php-fpm

/usr/local/php5.3.22/sbin/php-fpm

查看是否启动了9000端口:

netstat -ntplu | grep 9000

配置nginx:

user  nobody;

worker_processes  1;

server
     {
      listen  80;
             server_name  localhost;
      location / {
             root   html;
             index  index.html index.htm index.php;
             }

      location ~ \.php$ {
            root    /usr/local/nginx/html/php;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /usr/local/nginx/html/php$fastcgi_script_name;
            include        fastcgi_params;
        }
}

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.