legend3---用Homestead配置后报错“No input file specified.”
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目錄就解決了這個報錯。
下面是無意中發現這個細節錯誤的過程。
1、你安裝的Homestead目錄下,輸入以下命令進入虛擬機(已經啟動vagrant up):
vagrant ssh2、查看nginx配置文件(/etc/nginx/sites-available/)
cd /etc/nginx/sites-available用vim命令查看當前目錄下的網站域名文件:
3、發現站點指定的路徑是/home/vagrant/code/public,和我在Homestead.yaml配置的路徑Code大寫不同。
輸入 :q!退出編輯。
輸入exit退出虛擬機。
4、改正Homestead.yaml文件路徑。
5、重啟虛擬機
vagrant reload6、再次打開項目網頁就不報“No input file specified”這個錯了。
可能有人需要這個教程《Homestead中第一個Laravel項目502 Bad Gateway》。
?
三、出錯原因
自己項目上傳到github的時候多增加了一層legend3的github目錄,然后沒有去修改Homestead.yaml,所以nginx找不到文件了
?
?
?
?
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"?
?
?
?
?
?
轉載于:https://www.cnblogs.com/Renyi-Fan/p/11502962.html
總結
以上是生活随笔為你收集整理的legend3---用Homestead配置后报错“No input file specified.”的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: SweetAlert2模态窗的使用
- 下一篇: legend3---OpenSSL SS