PHP local server Invalid request (Unexpected EOF)

后端 未结 10 2073
故里飘歌
故里飘歌 2020-12-05 16:58

After every execution, regardless of said execution - when using Chrome web browser the PHP local server throws this error:

Invalid request (Unexpecte

相关标签:
10条回答
  • 2020-12-05 17:34

    This could be related to Chrome specifically and its network prediction feature. So try to disable that feature first. That's why it works for you in Incognito mode, because probably it's disabled in that mode.

    You can find this option in Chrome Settings and click on 'Show advanced settings'. Should be there in Privacy section.

    Use a prediction service to help complete searches and URLs typed in the address bar or the app launcher search box

    0 讨论(0)
  • 2020-12-05 17:35

    On Laravel 4.2, I resolve that when I clear the cache with command : php artisan cache:clear


    Complete list of commands is available with : php artisan list

    0 讨论(0)
  • 2020-12-05 17:38

    I had this error when running PHP on port 9000; after changing it to 8000 the error disappeared.

    0 讨论(0)
  • 2020-12-05 17:47

    In my case, I'm using laravel 5.1 + AngularJs and I had removed the route:

    **Route::get('/', function () {
        return view('app');
    });**
    

    I put this back and now it works fine.

    0 讨论(0)
  • 2020-12-05 17:49

    This is a known bug.

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

    [2011-12-08 15:01 UTC] lolautruche at gmail dot com Description:
    ------------
    From time to time, built-in server with router script logs this kind of stuff :

    [Thu Dec 8 13:39:29 2011] 127.0.0.1:50358 Invalid request (Unexpected EOF)

    This happens quite randomly, whatever the script has a close tag or not, whatever it has a blank line after close tag or not.

    And the explanation:

    [2012-02-23 18:45 UTC] michal dot pipa dot xsolve at gmail dot com
    ...
    Chromium has feature called "Predict network actions to improve page load performance" and its enabled by default. It works this way, that if HTML page has links to some resources, than Chromium opens about 10 TCP connections in advance. And then if browser has less than 10 resources to fetch, unused connections times out after 10 seconds. And this (empty payload) causes PHP server to display "Invalid request (unexpected EOF)" message.

    It is a harmless error from the PHP built-in server.

    0 讨论(0)
  • 2020-12-05 17:51

    I see this behaviour when in index.html

    <script src="main.js"></script>
    

    is replaced with

    <script src="main.js" />
    

    (instead of closing </script> tag its short version is used />).

    0 讨论(0)
提交回复
热议问题