Bug #67884 [Opn]: Doing a request to itself causes a lock

From: Date: Fri, 22 Aug 2014 04:17:38 +0000
Subject: Bug #67884 [Opn]: Doing a request to itself causes a lock
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-187231@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67884&edit=1 ID: 67884 Updated by: requinix@php.net Reported by: jgmdev@php.net Summary: Doing a request to itself causes a lock Status: Open Type: Bug Package: Built-in web server Operating System: Linux (Archlinux) PHP Version: 5.5.15 Block user comment: N Private report: N New Comment: Isn't the server single-threaded? The docs say right there at the top "PHP applications will stall if a request is blocked". Previous Comments: ------------------------------------------------------------------------ [2014-08-22 03:28:22] jgmdev@php.net 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 this bug report at https://bugs.php.net/bug.php?id=67884&edit=1

« previous php.bugs (#187231) next »