|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31078 Error fetching http headers
Submitted: 2004-12-14 02:28 UTC Modified: 2005-03-07 21:44 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: ivan dot chollet at lynanda dot com Assigned: dmitry (profile)
Status: Closed Package: SOAP related
PHP Version: 5.0.2 OS: freebsd 5.3
Private report: No CVE-ID: None
 [2004-12-14 02:28 UTC] ivan dot chollet at lynanda dot com
When the result of a web service function is a big string, PHP sends the error : Uncaught SoapFault exception: 
"[HTTP] Error fetching http headers in (/usr/local/ etc...)"

The code used to make it crash is very simple.

Reproduce code:
on the server, let call our file "soap-server.php" with the code :
function crashfun{
   return $result;

$server= new soapserver('somewsdlfile.wsdl') 

on the client side, let invoke the web service in "soap-client.php" :
$client=new soapclient("somewsdlfile.wsdl");


put all the files in the same directory

Expected result:
when you call on the command line "php -f soap-client.php > shit | vi shit", you see a beautiful file filled with "x"s.

set the upper bound for the for loop in the code to 100 000  and everything works well

set it to 2 000 000 and it crashes.

sorry i didn't take the time to check the exact limit for this upper bound and it's about 1 000 000

Actual result:
the actual result is the bug mentionned in "description"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-14 02:43 UTC] ivan dot chollet at lynanda dot com
if someone wants a wsdl file that works with then just ask me
(basically there is one function returning a string a taking no argument so very simple)
 [2004-12-14 13:31 UTC]
Try to incrise "memory_limit" in your php.ini.
Your soap server dies because of memory overflow and doesn't send HTTP response.

This is not a bug.

 [2004-12-14 18:26 UTC] ivan dot chollet at lynanda dot com
The problem is well addressed by the way you told me.
It works well.

The point is that your Soap extension consumes a large amount of memory.
In fact I set the memory limit to 64M to address the problem raised by the code above. 64M is much for a single php process. But if you change the upper bound to 3 million instead of 2 then it does not work anymore, so you would need memory_limit like 128M which is not reasonable.

The code above is a big variant of real world server code that should send a 800K string filled with db stuff. The server can send this 800K string through Soap only if memory_limit>256M. So at the moment there is only a solution  to make the service work : use sockets or switch on

Please tell me wether you plan to address it or not.

ivan chollet
 [2005-02-28 21:16 UTC]
Please try using this CVS snapshot:
For Windows:

 [2005-03-07 12:35 UTC] ivan dot chollet at lynanda dot com
it's seems like the bug is fixed. Congratulations !
however I wasn't able to install php 5.1 the "easy way". I had  much work to do after having configured with --enable-soap to get things work and I could not use the code above because the function soapclient doesn't work well with these sources.

 [2005-03-07 21:44 UTC]
Bug fixed -> closed.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 26 21:01:31 2024 UTC