在百度上怎么注册网站,wordpress oa主题,厦门网站seo建设,网络销售的好处和意义一 环境介绍:
win10, LNMP 二 错误描述:
访问网站时,提示No input file specified错误.
排错阶段: 1. 查看nginx access日志 (access.log)
发现提示404 错误 2. 分析原因:
这时,在同目录下创建一个txt文件,访问就可以正常输出了
这说明 现在nginx 访问php 没…一 环境介绍:
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给转义了。
在前面再加个\转义回来问题得以解决这个问题真的是太容易忽略了记录下来