laravel 框架问题

2017-01-13 10:27:43 +08:00
 phper69

laravel 项目部署在虚拟机上挂载的 windows 目录下,在虚拟机上配置 nginx 服务器,项目为什么访问不到?提示: No input file specified.

项目拿到挂载目录外面就可以

2290 次点击
所在节点    程序员
11 条回复
phper69
2017-01-13 10:29:59 +08:00
求助
baoguok
2017-01-13 10:36:40 +08:00
没挂载到,看看 php-fpm 和 nginx 的配置部分
phper69
2017-01-13 10:48:16 +08:00
@baoguok php-fpm 的用户是 www ,之前以为是文件夹权限问题,把挂载文件夹权限改为 777 ,不行
您指的配置会是哪块影响呢?
techmoe
2017-01-13 11:27:18 +08:00
fpm 路径错了,找不到脚本
老生常谈的问题。。
phper69
2017-01-13 11:33:23 +08:00
@techmoe 把项目移到挂载目录外层就可以了啊,/data/wwwroot/project , project 文件夹是挂载的 windows ,项目移到 wwwroot/下就可以,没改过配置啊
NoobPhper
2017-01-13 12:06:54 +08:00
拍黄片 69
yangqi
2017-01-13 12:09:03 +08:00
laravel 是要挂载到 laravel/public 目录下面,并不是根目录
techmoe
2017-01-13 12:16:54 +08:00
@phper69 nginx 配置方便贴出来看一下吗
phper69
2017-01-13 12:47:36 +08:00
@techmoe

nginx.conf

user root root;

worker_processes auto;

error_log /home/wwwlogs/nginx_error.log crit;

pid /usr/local/nginx/logs/nginx.pid;

#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;

events
{
use epoll;
worker_connections 51200;
multi_accept on;
}

http
{
include mime.types;
default_type application/octet-stream;

server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 50m;

sendfile on;
tcp_nopush on;

keepalive_timeout 60;

tcp_nodelay on;

fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 256k;

gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.1;
gzip_comp_level 2;
gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml application/xml+rss;
gzip_vary on;
gzip_proxied expired no-cache no-store private auth;
gzip_disable "MSIE [1-6]\.";

#limit_conn_zone $binary_remote_addr zone=perip:10m;
##If enable limit_conn_zone,add "limit_conn perip 10;" to server section.

server_tokens off;
access_log off;

include vhost/*.conf;
}


php-fpm.conf

[global]
pid = /usr/local/php/var/run/php-fpm.pid
error_log = /usr/local/php/var/log/php-fpm.log
log_level = notice

[www]
listen = /tmp/php-cgi.sock
listen.backlog = -1
listen.allowed_clients = 127.0.0.1
listen.owner = www
listen.group = www
listen.mode = 0666
user = www
group = www
pm = dynamic
pm.max_children = 10
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 6
request_terminate_timeout = 100
request_slowlog_timeout = 0
slowlog = var/log/slow.log
phper69
2017-01-13 12:52:28 +08:00
@techmoe vhost

server
{
listen 80;
#listen [::]:80;
server_name iron.com;
index index.html index.htm index.php default.html default.htm default.php;
root /data/wwwroot/project/iron/public;

include none.conf;
#error_page 404 /404.html;
include enable-php.conf;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}

location ~ /\.
{
deny all;
}

access_log /home/wwwlogs/www.blog.com.log;
}
abc123ccc
2017-01-13 15:07:32 +08:00
你可以弄一个其它页面比如 a.png ,看看能不能访问得到。如果能访问到,就是访问 PHP 配置段的问题。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/334291

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX