Nginx配置後無法解析PHP問題

2021-09-24 19:11:57 字數 520 閱讀 6228

location / {}表示請求根路徑時, 都會走這裡。第乙個uri

表示in

dex.

php(

入口檔案

),第二

個uri表示index.php(入口檔案),第二個

uri表示i

ndex

.php

(入口文

件),第

二個uri表示真實路徑,/index.php 表示前面都沒有的話訪問index.php,$args:所有引數。如果要處理url美化時,必須要配置這裡。

2.檢查127.0.0.1:9000埠是否處於監聽狀態,執行netstat -antp | grep 9000,發現並沒有被監聽,說明需要啟動。

3.執行php-cgi -b 127.0.0.1:9000 & 啟動之後,在執行netstat -antp結果:

4/重啟nginx,問題解決。

Linux安裝配置完nginx後無法解析php

location php 表示匹配到php檔案就進行fastcgi操作。location 表示請求根路徑時,都會走這裡。第乙個uri表示index.php 入口檔案 第二個uri表示index.php 入口檔案 第二個uri表示index.php 入口檔案 第二個uri表示真實路徑,index.ph...

解決lnmp環境nginx無法解析php檔案

lnmp環境nginx無法解析php檔案,html正常解析。出現nginx無法解析php顯示404 not found 一鍵安裝lnmp環境,內含nginx。首先先安裝php fpm,yum install php fpm service php fpm start 啟動 php fpm 然後修改n...

CentOS6 5 Nginx無法解析php檔案

nginx 已經安裝完畢,並且能夠訪問 php 版本 php vphp 5.3 3 cli built mar 22 2017 12 27 09 thephp group zend engine v2.3 zend technologies nginx 版本 root bogon sbin ngin...