centos php-fpm nginx配置

石橋碼農發表於2015-08-06
移除舊的軟體包:
yum remove httpd* php*
安裝:
yum install php php-fpm yum install php-gd php-mysql php-mbstring php-xml php-mcrypt
驗證配置檔案: /etc/init.d/nginx configtest
重啟: /etc/init.d/nginx restart /etc/init.d/php-fpm restart 出現這個錯誤可能是路徑寫錯了: Access denied. nginx php-fpm 訪問.php檔案出現Access denied

也可能是許可權,改為nginx: vi /etc/php-fpm.d/www.conf ; Unix user/group of processes ; Note: The user is mandatory. If the group is not set, the default user's group ; will be used. ; RPM: apache Choosed to be able to access some dir as httpd user = nginx ; RPM: Keep a group allowed to write in log dir. group = nginx nginx節點配置示例: server { listen 80; server_name domain; root /wwwdir; location / { index index.html index.htm index.php; } # location ~ \.php$ { include fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } }

  

相關文章