nginx - php file not found
程序员文章站
2024-04-05 22:43:43
...
用vagrant 配置了环境,但是死活都是‘file not found’
vagrant版本
vagrant版本
Vagrant 1.6.5
目录权限是
drwxr-xr-x 1 vagrant vagrant
nginx 报错信息
[error] 2186#0: *32 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 192.168.33.1, server: xxx.xxx.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:"
nginx配置
server {
listen 80; ## listen for ipv4; this line is default and implied
server_name xxx.xxx.com;
root /vagrant/demo;
index index.php;
# Make site accessible from http://localhost/
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php$1 last;
}
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
网上的都试过了,还是不行。
回复内容:
用vagrant 配置了环境,但是死活都是‘file not found’
vagrant版本
Vagrant 1.6.5
目录权限是
drwxr-xr-x 1 vagrant vagrant
nginx 报错信息
[error] 2186#0: *32 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 192.168.33.1, server: xxx.xxx.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:"
nginx配置
server {
listen 80; ## listen for ipv4; this line is default and implied
server_name xxx.xxx.com;
root /vagrant/demo;
index index.php;
# Make site accessible from http://localhost/
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php$1 last;
}
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
网上的都试过了,还是不行。
上一篇: net-mysql数据库查询的格式化
推荐阅读
-
nginx - php file not found
-
PHP错误Parse error: syntax error, unexpected end of file in test.php on line 12解决方法_PHP教程
-
为PHP安装imagick时出现Cannot locate header file MagickWand.h错误的解决方
-
Linux下php+mysql+nginx编译搭建(三)
-
PHP加Nginx实现动态裁剪图片方案
-
nginx服务器*问不存在的php页面No input file specified
-
windows?????????nginx+php?????? - ?????????
-
fastcgi +php 提示 No input file specified.如何解决
-
swoole - PHP如何设置file_get_contents('php://input')?
-
nginx+thinkphp下解决不支持pathinfo模式以及存在的各种404,500问题,nginxpathinfo_PHP教程