6
Eventually on the console or cmd error appears Invalid request (Unexpected EOF)
, note that I understand what EOF means, which is Andnd Thef File, but I don’t understand why exactly this happens.
At first I thought it was something related to conflicts with IPV6, but I’m not sure now, note that I’m using a routing script, the result is something like:
PHP 5.6.14 Development Server started at Tue Oct 04 10:39:40 2016 Listening on http://localhost:9000 Document root is C:\Users\Guilherme\Documents\GitHub\inphinit Press Ctrl-C to quit. [Tue Oct 04 10:40:13 2016] ::1:62748 Invalid request (Unexpected EOF) [Tue Oct 04 10:40:13 2016] ::1:62749 Invalid request (Unexpected EOF)
Note that the server does not stop working, I’m just curious to understand why this
Command is like this:
php -S localhost:9000 router.php
He’s like this basically:
<?php
$serverPath = realpath(dirname(__FILE__) . '/../../');
$serverPath = rtrim(strtr($serverPath, '\\', '/'), '/') . '/';
$path = urldecode(preg_replace('#\?(.*)$#', '', $_SERVER['REQUEST_URI']));
$path = ltrim($path, '/');
if (
$path !== '' &&
$path !== '/' &&
strcasecmp($path, 'system') !== 0 &&
stripos($path, 'system/') !== 0 &&
file_exists($serverPath . $path)
) {
return false;
}
echo 'Oi';
The problem seems to occur only when I use a routing script, I noticed the problem in windows, but I did not get to test in Unix-like environments and do not know if this occurs in them, I did the tests in:
- Windows 8.1 x64
- PHP 5.6.14 x64 and x86
I tested on two different machines
Apparently is a bug. Have you tried clearing your browser cache? or trying "private mode"?
– stderr
@stderr I will try and I will even try a different browser than Chrome and I warn you :)
– Guilherme Nascimento
msm using 64-bit windows versions, its both php and apache installments must be 32-bit to prevent headaches.
– Tiago NET
@Tiagonet is not a problem with apache, the problem is with "php built-in server", and the problem occurs in php32bt and php64ibt, the situation is different.
– Guilherme Nascimento
@stderr just tested now, the problem occurs without the router too, so you don’t have what to fix in the router
– Guilherme Nascimento