php.net |  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
Votes:8
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
Have you experienced this issue?
Rate the importance of this bug to you:

 [2011-12-08 16:22 UTC] lolautruche at gmail dot com
Description:
------------
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 : https://gist.github.com/1447481

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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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

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] laruence@php.net
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. 

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

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 ?

Thanks
 [2011-12-09 13:35 UTC] lolautruche at gmail dot com
-Status: Feedback +Status: Assigned
 [2011-12-09 13:59 UTC] laruence@php.net
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
Host: ezpublish.dev
Port: 8000
File: /design/admin2/stylesheets/theme/modalwindow.css
Remote-Address: 127.0.0.1
Client-Address: 127.0.0.1
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
Request-Header:<<--EOF-1323439906166-
GET /design/admin2/stylesheets/theme/modalwindow.css HTTP/1.1
Host: ezpublish.dev:8000
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
Referer: http://ezpublish.dev:8000/plain_site_admin/content/view/full/2
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; 
eZSESSIDa8f71cffda7ca9763445db0b3afb4957=93vhe4inndpt5ghahfjcuofpc6; 
is_logged_in=true; XDEBUG_SESSION=netbeans-xdebug


--EOF-1323439906166-
Response-Header:<<--EOF-1323439906166-
HTTP/1.1 200 OK
Host: ezpublish.dev:8000
Connection: closed
Content-Type: text/css; charset=UTF-8
Content-Length: 2137


--EOF-1323439906166-
 [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] kalle@php.net
-Status: Assigned +Status: Open -Assigned To: laruence +Assigned To:
 [2021-08-18 10:51 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-08-18 10:51 UTC] cmb@php.net
Is this still an issue with any of the actively supported PHP
versions[1]?

[1] <https://www.php.net/supported-versions.php>
 [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-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 02:01:28 2024 UTC