首页 技术 正文
技术 2022年11月21日
0 收藏 666 点赞 2,786 浏览 2633 个字

legend3—用Homestead配置后报错“No input file specified.”

一、总结

一句话总结:

自己项目上传到github的时候多增加了一层legend3的github目录,然后没有去修改Homestead.yaml,所以nginx找不到文件了
用 查看错误日志 的方法可以比较快的排查错误

1、No input file specified错误 出现的最可能的原因是什么?

No input file specified表示apache或者nginx没有找到文件,那么最有可能的原因就是配置的路径出错

2、用Homestead配置后报错“No input file specified.”的排错方向是什么?

肯定是apache服务器或者nginx服务器没找到文件,去看看apache或者 nginx的配置

3、排查错误比较好的方法是什么?

查看错误日志:nginx错误日志的位置 为:/var/log/nginx/
2019/09/10 18:42:03 [error] 1267#1267: *12 FastCGI sent in stderr: "Unable to open primary script: /home/vagrant/legend3/public/index.php (No such file or directory)" while reading response header from upstream, client: 192.168.10.1, server: legend3.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.3-fpm.sock:", host: "legend3.com"
2019/09/10 18:42:05 [error] 1267#1267: *12 FastCGI sent in stderr: "Unable to open primary script: /home/vagrant/legend3/public/index.php (No such file or directory)" while reading response header from upstream, client: 192.168.10.1, server: legend3.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.3-fpm.sock:", host: "legend3.com"

4、Homestead重启虚拟机指令?

vagrant reload

二、用Homestead配置laravel开发环境后网页报错“No input file specified.”

转自或参考:用Homestead配置laravel开发环境后网页报错“No input file specified.”
https://blog.csdn.net/haisley/article/details/82083203

 

用Homestead配置laravel开发环境后,打开项目网页报错“No input file specified”,没有指定输入文件

查找原因,发现虚拟机nginx站点指定的文件夹是/home/vagrant/code/public,而我在Homestead目录下的Homestead.yaml文件里,sites指定的目录是/home/vagrant/Code/public,大小写不同导致路径不同了,所以站点指定目录code下其实是没有代码的,会报错。

所以我把Homestead.yaml文件里的站点修改成指定小写code目录就解决了这个报错。

legend3—用Homestead配置后报错“No input file specified.”

下面是无意中发现这个细节错误的过程。

1、你安装的Homestead目录下,输入以下命令进入虚拟机(已经启动vagrant up):

vagrant ssh

2、查看nginx配置文件(/etc/nginx/sites-available/)

cd /etc/nginx/sites-available

用vim命令查看当前目录下的网站域名文件:

legend3—用Homestead配置后报错“No input file specified.”

3、发现站点指定的路径是/home/vagrant/code/public,和我在Homestead.yaml配置的路径Code大写不同。

legend3—用Homestead配置后报错“No input file specified.”

输入 :q!退出编辑。

输入exit退出虚拟机。

4、改正Homestead.yaml文件路径。

legend3—用Homestead配置后报错“No input file specified.”

5、重启虚拟机

vagrant reload

6、再次打开项目网页就不报“No input file specified”这个错了。

可能有人需要这个教程《Homestead中第一个Laravel项目502 Bad Gateway》。

三、出错原因

自己项目上传到github的时候多增加了一层legend3的github目录,然后没有去修改Homestead.yaml,所以nginx找不到文件了

legend3—用Homestead配置后报错“No input file specified.”

legend3—用Homestead配置后报错“No input file specified.”

nginx错误日志内容:

2019/09/10 18:42:03 [error] 1267#1267: *12 FastCGI sent in stderr: "Unable to open primary script: /home/vagrant/legend3/public/index.php (No such file or directory)" while reading response header from upstream, client: 192.168.10.1, server: legend3.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.3-fpm.sock:", host: "legend3.com"
2019/09/10 18:42:05 [error] 1267#1267: *12 FastCGI sent in stderr: "Unable to open primary script: /home/vagrant/legend3/public/index.php (No such file or directory)" while reading response header from upstream, client: 192.168.10.1, server: legend3.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.3-fpm.sock:", host: "legend3.com"

legend3—用Homestead配置后报错“No input file specified.”

 

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:8,905
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,430
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,247
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,058
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,690
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,727