Laravel 4.1 无效请求意外 EOF
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20570175/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Laravel 4.1 Invalid request Unexpected EOF
提问by hasib32
I am trying to install Laravel 4.1. After installed when i run php artisan serve I get this error: Invalid request (Unexpected EOF). I have no idea why it's showing this error. I also have laravel 4.0 installed and it's working fine.
我正在尝试安装 Laravel 4.1。安装后,当我运行 php artisan serve 时出现此错误:无效请求(意外 EOF)。我不知道为什么它会显示此错误。我也安装了 laravel 4.0,它工作正常。
回答by Antonio Frignani
Landed here after having this problem myself. Searching around, the error seems to be related to the network prediction feature of some browser (primarily Chrome). Disabling the feature, did the trick for me on Windows with php 5.4.9
在我自己遇到这个问题后登陆这里。找了一圈,错误似乎与某些浏览器(主要是Chrome)的网络预测功能有关。禁用该功能,在 Windows 上使用 php 5.4.9 为我解决了这个问题
回答by aug
I also had this problem. I believe if you are serving with artisan
you have to specify the port number like so:
我也有这个问题。我相信如果您与您一起服务,artisan
您必须像这样指定端口号:
./artisan serve --port=XXXX --host=whatever.com
The problem for me was I didn't set the base
correctly. Make sure that in your file your base
is set to be at this port as well. So for my case, I had to set my index.html
to be
我的问题是我没有base
正确设置。确保在您的文件中您base
也设置为在此端口。所以对于我的情况,我必须将我的index.html
设置为
<base href="http://www.whatever.com:XXXX/" />
After I fixed that, it served correctly. Hope this helps.
在我解决这个问题后,它服务正确。希望这可以帮助。
EDIT: Oh and FYI make sure what you type in your browser is exactly the same as what you set your base
to be. So that means you can't do whatever.com:XXXX
and expect it to serve. You're gonna need to do www.whatever.com:XXXX
. Life is frustrating sometimes.
编辑:哦,仅供参考,请确保您在浏览器中输入的内容与您设置的完全相同base
。所以这意味着你不能做whatever.com:XXXX
并期望它服务。你需要做www.whatever.com:XXXX
。生活有时令人沮丧。
回答by devo
Make sure you are updated the installation successfully.
确保您已成功更新安装。
Run this in your project directory.
在您的项目目录中运行它。
composer update