日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > windows >内容正文

windows

windows下, nginx 提示错误 No input file specified

發布時間:2023/12/4 windows 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 windows下, nginx 提示错误 No input file specified 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

一 環境介紹:

win10,? LNMP

?

二 錯誤描述:

訪問網站時,提示"No input file specified"錯誤.

排錯階段:

?

1. 查看nginx access日志 (access.log)

發現提示404 錯誤

?

2. 分析原因:

這時,在同目錄下創建一個txt文件,訪問就可以正常輸出了

這說明 現在nginx 訪問php 沒有輸出,意味著沒有對php文件進行解析

這樣問題就明朗了,多半和 cgi 以及 location的定義有關

?

3. 解決方案:

在對應域名的vhost配置文件中添加對php文件的解析

注: 在項目中,我們經常會用到redis,而有時我們項目出現莫名的錯誤,很可能就和redis有關,所以,我們要養成一旦項目出現錯誤, 首先排查redis , 看redis 是否可以正常連接 .?

4. 具體配置文件代碼如下:

?

server {listen 80;server_name test.kk.com;charset utf-8;access_log logs/access/test.kk.com.access.log main;error_log logs/error/test.kk.com.error.log debug;root "E:/PHP/phpstudy/WWW/Project/kk";index index.html index.htm index.php;location /favicon.ico {log_not_found off;access_log off;}location /static/original {}location /static {access_log off;}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;include fastcgi_params;}location / {if (!-e $request_filename) {rewrite ^/comic-detail-(\d+)/ /mh-$1/ permanent;rewrite ^/comic-detail-(\d+)/(\d+)/ /mh-$1/$2/ permanent;rewrite ^/show-(\d+)-(\d+)/ /mh-$1/$2/ permanent;rewrite ^/show-(\d+)-(\d+)-(\d+)/ /mh-$1/$2-$3/ permanent;rewrite ^/mh-(\d+)/(\d+)/$ /read-comic-$1-$2/ last;rewrite ^/mh-(\d+)/(\d+)-(\d+)/$ /read-comic-$1-$2-$3/ last;rewrite "^/uploads/manhua/\d+/\d{4}-(\d{3})-(\d{2})-(\d{2})-(\d{2})-(\d+)-(.*)$" /static/comic2/$1/$2/$3/$4/$5/$6 last;rewrite ^/(.*)$ /index.php?$1 last;}}location /union/ {rewrite ^/union/(.*)$ /union/index.php?$1 last;}location ~ /\.ht {deny all;} }

?

?

后記:

在本地配置了一個本地站 ,nginx配置文件?

看起來似乎沒有什么問題,很簡單的一個配置,但是打開該域名后,卻發現報404。

反復檢查路徑,絕對沒有任何問題啊,怎么會連html文件都報404呢,如果連html文件都報404,那絕對不是因為cgi的配置問題,肯定是和路徑有關,但是路徑檢查了很多遍了啊,看看nginx 這個網站的錯誤日志看看有沒有什么收獲吧,反復看了之后,你猜我發現了什么?

what?居然是est,我配置文件里命名寫的是test這個單詞,忽然我想起來了,靠,他把我的 ‘\test中’的 '\t'給轉義了。

在前面再加個\轉義回來,問題得以解決,這個問題真的是太容易忽略了,記錄下來

總結

以上是生活随笔為你收集整理的windows下, nginx 提示错误 No input file specified的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。