php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66690 built-in web server hangs at second invocation
Submitted: 2014-02-10 23:04 UTC Modified: 2014-04-02 11:21 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: gn-php-bug at hothaus dot de Assigned: ab (profile)
Status: Not a bug Package: Built-in web server
PHP Version: 5.5.10 OS: Windows 8
Private report: No CVE-ID: None
 [2014-02-10 23:04 UTC] gn-php-bug at hothaus dot de
Description:
------------
the first php document submitted to the built-in web server works correctly. But any subsequent document (same as first or any other) causes the browser to hang for two minutes. Then, Firefox (V23)  says something like "Error: time exceeded", and IE 10 says "document cannot be shown". 

(I can't report the exact English wordings here, because I'm using German versions of FF and IE). 

If I stop and restart the PHP Built-in webserver, it works again, but again only for one document. 

The problem occurs only on Windows 8.  It works just fine on Windows 7.

Test script:
---------------
<html>
 <head>
  <title>PHP-Test</title>
 </head>
 <body>
 <?php echo '<p>Hello World</p>'; ?>
 </body>
</html> 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-02-11 10:43 UTC] gn-php-bug at hothaus dot de
-PHP Version: 5.4.25 +PHP Version: 5.5.9
 [2014-02-11 10:43 UTC] gn-php-bug at hothaus dot de
I have tried it with the latest PHP Version 5.5.9.  It has the same problem.
 [2014-04-01 17:13 UTC] ab@php.net
-Status: Open +Status: Feedback
 [2014-04-01 17:13 UTC] ab@php.net
Please post your ini. Also, have you tried the same with no extensions loaded? Where did you get your PHP build?
 [2014-04-01 18:57 UTC] gn-php-bug at hothaus dot de
-Status: Feedback +Status: Open -PHP Version: 5.5.9 +PHP Version: 5.5.10
 [2014-04-01 18:57 UTC] gn-php-bug at hothaus dot de
I used php-5.5.10-nts-Win32-VC11-x86.zip
downloaded from http://windows.php.net/download/
The ini file is php.ini-development, renamed to php.ini
The ini file is otherwise unmodified as supplied with above package.
The extensions are as supplied with above package.
 [2014-04-01 23:59 UTC] johannes@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: ab
 [2014-04-01 23:59 UTC] johannes@php.net
Assign to Windows expert to follow up
 [2014-04-02 07:24 UTC] ab@php.net
-Status: Assigned +Status: Feedback
 [2014-04-02 07:24 UTC] ab@php.net
@gn-php-bug that's what i see here on win8 with your snippet

>php -S 127.0.0.1:8080 -t.

$ curl -v http://127.0.0.1:8080/66690.php
* About to connect() to 127.0.0.1 port 8080 (#0)
*   Trying 127.0.0.1...
* Adding handle: conn: 0x2317e80
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x2317e80) send_pipe: 1, recv_pipe: 0
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> GET /66690.php HTTP/1.1
> User-Agent: curl/7.30.0
> Host: 127.0.0.1:8080
> Accept: */*
>
< HTTP/1.1 200 OK
< Host: 127.0.0.1:8080
< Connection: close
< X-Powered-By: PHP/5.5.12-dev
< Content-type: text/html
<
<html>
 <head>
  <title>PHP-Test</title>
 </head>
 <body>
 <p>Hello World</p> </body>
</html>
* Closing connection 0

So no reproduce for me, any request is served. Have to figure out what the difference is, maybe something of this could help
- try another win8 machine
- try to change the port
- try to change ip
- use curl or anything else you can to see more in background

Maybe you could take a closer look on the diff in the network configuration between your win7 and win8.

Thanks
 [2014-04-02 10:06 UTC] gn-php-bug at hothaus dot de
-Status: Feedback +Status: Assigned
 [2014-04-02 10:06 UTC] gn-php-bug at hothaus dot de
I looked at what was the difference between the example you gave me and what I used, and here is what I found:

I used to use the URL as shown in the PHP manual at http://www.php.net/manual/en/features.commandline.webserver.php 

php -S localhost:8000
http://localhost:8000

This leads to the desctibed malfunction on Windows 8.

But if I use your version:

php -S 127.0.0.1:8000
http://127.0.0.1:8000

It works on my Windows 8 system.
 [2014-04-02 10:20 UTC] gn-php-bug at hothaus dot de
This combination also works: 

php -S 127.0.0.1:8000
http://localhost:8000
 [2014-04-02 10:22 UTC] gn-php-bug at hothaus dot de
This is the CURL trace in the malfunctioning case: 

I:\save\curl64>curl -v http://localhost:8000/
* Adding handle: conn: 0x2103b90
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x2103b90) send_pipe: 1, recv_pipe: 0
* About to connect() to localhost port 8000 (#0)
*   Trying 127.0.0.1...
* Connection refused
* Failed connect to localhost:8000; No error
* Closing connection 0
curl: (7) Failed connect to localhost:8000; No error

I:\save\curl64>
 [2014-04-02 11:21 UTC] ab@php.net
-Status: Assigned +Status: Not a bug
 [2014-04-02 11:21 UTC] ab@php.net
Great, thanks for staying on this. Using 'localhost' literally was always not that reliable on Windows. To be safe, an IP address is a better solution. Win8 seems also to depend on some more configuration than just changing C:\Windows\System32\drivers\etc\hosts , intranet and DNS settings are involved. However the hosts file could also work when disabling the DNS client service (but not sure it's worth an experiment).

As this is a configuration issue, marking as not a bug.

Thanks
 [2014-04-22 10:31 UTC] gn-php-bug at hothaus dot de
Not a bug? OK. But the documentation should be updated, no? It currently describes an approach that definitly does not work on Windows 8. Thanks anyway.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Jul 20 20:01:26 2019 UTC