legend3---用Homestead配置后报错“No input file specified.”
legend3---用Homestead配置后報(bào)錯(cuò)“No input file specified.”
一、總結(jié)
一句話總結(jié):
自己項(xiàng)目上傳到github的時(shí)候多增加了一層legend3的github目錄,然后沒(méi)有去修改Homestead.yaml,所以nginx找不到文件了
用 查看錯(cuò)誤日志 的方法可以比較快的排查錯(cuò)誤
?
1、No input file specified錯(cuò)誤 出現(xiàn)的最可能的原因是什么?
No input file specified表示apache或者nginx沒(méi)有找到文件,那么最有可能的原因就是配置的路徑出錯(cuò)
?
2、用Homestead配置后報(bào)錯(cuò)“No input file specified.”的排錯(cuò)方向是什么?
肯定是apache服務(wù)器或者nginx服務(wù)器沒(méi)找到文件,去看看apache或者 nginx的配置
?
3、排查錯(cuò)誤比較好的方法是什么?
查看錯(cuò)誤日志:nginx錯(cuò)誤日志的位置 為:/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重啟虛擬機(jī)指令?
vagrant reload
?
?
二、用Homestead配置laravel開(kāi)發(fā)環(huán)境后網(wǎng)頁(yè)報(bào)錯(cuò)“No input file specified.”
轉(zhuǎn)自或參考:用Homestead配置laravel開(kāi)發(fā)環(huán)境后網(wǎng)頁(yè)報(bào)錯(cuò)“No input file specified.”
https://blog.csdn.net/haisley/article/details/82083203
用Homestead配置laravel開(kāi)發(fā)環(huán)境后,打開(kāi)項(xiàng)目網(wǎng)頁(yè)報(bào)錯(cuò)“No input file specified”,沒(méi)有指定輸入文件。
查找原因,發(fā)現(xiàn)虛擬機(jī)nginx站點(diǎn)指定的文件夾是/home/vagrant/code/public,而我在Homestead目錄下的Homestead.yaml文件里,sites指定的目錄是/home/vagrant/Code/public,大小寫不同導(dǎo)致路徑不同了,所以站點(diǎn)指定目錄code下其實(shí)是沒(méi)有代碼的,會(huì)報(bào)錯(cuò)。
所以我把Homestead.yaml文件里的站點(diǎn)修改成指定小寫code目錄就解決了這個(gè)報(bào)錯(cuò)。
下面是無(wú)意中發(fā)現(xiàn)這個(gè)細(xì)節(jié)錯(cuò)誤的過(guò)程。
1、你安裝的Homestead目錄下,輸入以下命令進(jìn)入虛擬機(jī)(已經(jīng)啟動(dòng)vagrant up):
vagrant ssh2、查看nginx配置文件(/etc/nginx/sites-available/)
cd /etc/nginx/sites-available用vim命令查看當(dāng)前目錄下的網(wǎng)站域名文件:
3、發(fā)現(xiàn)站點(diǎn)指定的路徑是/home/vagrant/code/public,和我在Homestead.yaml配置的路徑Code大寫不同。
輸入 :q!退出編輯。
輸入exit退出虛擬機(jī)。
4、改正Homestead.yaml文件路徑。
5、重啟虛擬機(jī)
vagrant reload6、再次打開(kāi)項(xiàng)目網(wǎng)頁(yè)就不報(bào)“No input file specified”這個(gè)錯(cuò)了。
可能有人需要這個(gè)教程《Homestead中第一個(gè)Laravel項(xiàng)目502 Bad Gateway》。
?
三、出錯(cuò)原因
自己項(xiàng)目上傳到github的時(shí)候多增加了一層legend3的github目錄,然后沒(méi)有去修改Homestead.yaml,所以nginx找不到文件了
?
?
?
?
nginx錯(cuò)誤日志內(nèi)容:
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"?
?
?
?
?
?
轉(zhuǎn)載于:https://www.cnblogs.com/Renyi-Fan/p/11502962.html
總結(jié)
以上是生活随笔為你收集整理的legend3---用Homestead配置后报错“No input file specified.”的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: SweetAlert2模态窗的使用
- 下一篇: legend3---OpenSSL SS