nginx解析不了php檔?
推薦學習:PHP影片教學
#1、檢視nginx.conf是否配置正確
格式:
location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_split_path_info ^((?U).+\.php)(/?.+)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;# $document_root是root指定的路径 include fastcgi_params; }
2、重載nginx設定
/usr/local/nginx/nginx -s reload
3、檢視php-fpm是否啟動 ps -aux |grep php
已啟動:
#
以上是nginx解析不了php文件的詳細內容。更多資訊請關注PHP中文網其他相關文章!