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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 08:45:40  来源:igfitidea点击:

Laravel 4.1 Invalid request Unexpected EOF

laravellaravel-4

提问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 为我解决了这个问题

Source: https://bugs.php.net/bug.php?id=60471

来源:https: //bugs.php.net/bug.php?id=60471

回答by aug

I also had this problem. I believe if you are serving with artisanyou 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 basecorrectly. Make sure that in your file your baseis set to be at this port as well. So for my case, I had to set my index.htmlto 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 baseto be. So that means you can't do whatever.com:XXXXand 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