Bug #67884 [NEW]: Doing a request to itself causes a lock
| From: | jgmdev@php.net | Date: | Fri, 22 Aug 2014 03:28:24 +0000 |
| Subject: | Bug #67884 [NEW]: Doing a request to itself causes a lock | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-187230@lists.php.net to get a copy of this message | ||
From: jgmdev@php.net
Operating system: Linux (Archlinux)
PHP version: 5.5.15
Package: Built-in web server
Bug Type: Bug
Bug description:Doing a request to itself causes a lock
Description:
------------
The built-in testing webserver locks down if current executing script
makes a request using file_get_contents, get_headers, as any function
which supports the http:// streams that makes a request to itself.
With the router test script provided try:
php -S localhost:8001 router-test.php
wget http://localhost:8001/something (works fine)
wget http://localhost:8001/ (lock when requesting /something)
Test script:
---------------
<?php
$path = "";
if(isset($_SERVER["PHP_SELF"]))
{
$path .= ltrim($_SERVER["PHP_SELF"], "/");
}
if($path == "something")
{
print "something";
}
else
{
print "nothing";
// Locks here
print file_get_contents("http://localhost:8001/something");
}
Expected result:
----------------
Request to http://localhost:8001/ should print nothingsomething
Actual result:
--------------
The php built-in webserver locks when trying to request
http://localhost:8001/something.
--
Edit bug report at https://bugs.php.net/bug.php?id=67884&edit=1
--