nginx-访问挂载的win下共享目录php文件出错
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了nginx-访问挂载的win下共享目录php文件出错,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2866字,纯文字阅读大概需要5分钟。
内容图文
![nginx-访问挂载的win下共享目录php文件出错](/upload/InfoBanner/zyjiaocheng/239/68f826f80d994e3ca02b0145bd9b747c.jpg)
然而出现了奇怪的问题:
nginx: File not found.
查看nginx log
> FastCGI sent in stderr: "Primary script unknown" while reading
> response header from upstream, client: 192.168.199.212, server:
> tqq.dev.com, request: "GET /ly/test2.php HTTP/1.1", upstream:
> "fastcgi://127.0.0.1:9000" host: "tqq.dev.com", referrer:
> "http://tqq.dev.com/ly/"
附上nginx 配置
server {
listen 80;
server_name tqq.dev.com;
root /usr/local/dev;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
index index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
}
在/usr/local/dev;
目录下php文件访问正常,新建目录创建php文件访问也是正常的,唯独挂载在dev目录下的共享文件夹下面的 php 文件不能正常访问,html文件访问正常
回复内容:
ubuntu 做了一个php的开发环境,然后想把win下的开发目录共享 挂载到 ubuntu下。
然而出现了奇怪的问题:
nginx: File not found.
查看nginx log
> FastCGI sent in stderr: "Primary script unknown" while reading
> response header from upstream, client: 192.168.199.212, server:
> tqq.dev.com, request: "GET /ly/test2.php HTTP/1.1", upstream:
> "fastcgi://127.0.0.1:9000" host: "tqq.dev.com", referrer:
> "http://tqq.dev.com/ly/"
附上nginx 配置
server {
listen 80;
server_name tqq.dev.com;
root /usr/local/dev;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
index index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
}
在/usr/local/dev;
目录下php文件访问正常,新建目录创建php文件访问也是正常的,唯独挂载在dev目录下的共享文件夹下面的 php 文件不能正常访问,html文件访问正常
看下php的配置文件,看运行php的User和Group是否和nginx不同
内容总结
以上是互联网集市为您收集整理的nginx-访问挂载的win下共享目录php文件出错全部内容,希望文章能够帮你解决nginx-访问挂载的win下共享目录php文件出错所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。