|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60473 Built-in server randomly closes connections
Submitted: 2011-12-08 16:22 UTC Modified: 2021-08-29 04:22 UTC
Avg. Score:2.2 ± 1.0
Reproduced:1 of 2 (50.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: lolautruche at gmail dot com Assigned: cmb (profile)
Status: No Feedback Package: Built-in web server
PHP Version: 5.4.0RC2 OS: Mac OS X 10.7.2 (Lion)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: lolautruche at gmail dot com
New email:
PHP Version: OS:


 [2011-12-08 16:22 UTC] lolautruche at gmail dot com
When using built-in server with a regular PHP application (eZ Publish in my 
case), and with many design ressources going through the server, it regularly 
fails to serve some ressources to the browser (randomly).

I'm using a router with rewrite rules emulations (with regexp), so it might come 
from here, but there is no error logged anywhere :-(

Please note that this has been tested with only one user. 

Test script:
php -S localhost:8000 router.php

My router script :

Expected result:
All requested ressources should be served, or at least there should be an error 
message explaining why connection has been closed


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-12-09 05:45 UTC]
Hi, what do you mean by "connection closed"? 
500 error?
 [2011-12-09 05:45 UTC]
-Status: Open +Status: Feedback
 [2011-12-09 05:46 UTC]
-Assigned To: +Assigned To: laruence
 [2011-12-09 09:09 UTC] lolautruche at gmail dot com

No, I mean that there is no response at all. The browser opens the connection and 
the built-in server closes it "unexpectedly"
 [2011-12-09 13:11 UTC]
Hi, if there is no any error message in log, then it must because you return false 
at your route script if the script_name is not valid.

you can try print something just above the last "return false" statement. 

 [2011-12-09 13:35 UTC] lolautruche at gmail dot com

Unfortunately, trying to print something doesn't help since PHP webserver doesn't 
serve the ressource. Trying to call error_log() before returning false doesn't 
seem to help either.
How can SCRIPT_NAME be invalid ?

 [2011-12-09 13:35 UTC] lolautruche at gmail dot com
-Status: Feedback +Status: Assigned
 [2011-12-09 13:59 UTC]
sorry, I mis-understand your router, but I can't reproduce this with the router 
you gived...

can you make a deep search, to find a 100% reproduce-able way?
 [2011-12-09 14:14 UTC] lolautruche at gmail dot com
OK, I'll dig.
But another info: this happens regardless there is a router script or not.

An HTTP trace example :

Method: GET
Protocol-Version: HTTP/1.1
Protocol: http
Port: 8000
File: /design/admin2/stylesheets/theme/modalwindow.css
Start-Time: 2011-12-09T15:10:43.625+01:00
Request-Time: 2011-12-09T15:10:43.629+01:00
Response-Time: 2011-12-09T15:10:43.707+01:00
End-Time: 2011-12-09T15:10:43.710+01:00
Request-Header-Size: 643
Response-Header-Size: 126
Request-Body-Size: 0
Response-Body-Size: 2137
Request-Body-Decoded: false
Response-Body-Decoded: false
GET /design/admin2/stylesheets/theme/modalwindow.css HTTP/1.1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.2 
(KHTML, like Gecko) Chrome/15.0.874.121 Safari/535.2
Accept: text/css,*/*;q=0.1
Accept-Encoding: gzip,deflate,sdch
Accept-Language: fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: adminNavigationTab=view; contentStructureMenu=5/2/43; 
is_logged_in=true; XDEBUG_SESSION=netbeans-xdebug

HTTP/1.1 200 OK
Connection: closed
Content-Type: text/css; charset=UTF-8
Content-Length: 2137

 [2011-12-09 14:42 UTC] lolautruche at gmail dot com
Dear Laruence

Please note that I'm using the webserver from a browser (tested with Firefox & 
Chrome), with ~60 ressources loaded from the main generated HTML code (images, 
css, js...)
 [2017-10-24 07:57 UTC]
-Status: Assigned +Status: Open -Assigned To: laruence +Assigned To:
 [2021-08-18 10:51 UTC]
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-08-18 10:51 UTC]
Is this still an issue with any of the actively supported PHP

[1] <>
 [2021-08-29 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Thu Jun 30 23:03:49 2022 UTC