php.net |  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
Votes:1
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
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ivan dot chollet at lynanda dot com
New email:
PHP Version: OS:

 

 [2004-12-14 02:28 UTC] ivan dot chollet at lynanda dot com
Description:
------------
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 :
<?php 
function crashfun{
   for($i=0,$i<=2000000,$i++){
      $result.='x';
   }
   return $result;
}

$server= new soapserver('somewsdlfile.wsdl') 
$server->addfunction('crashfun');
$server->handle();
?>



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

?>

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"


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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

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

ivan chollet
 [2005-02-28 21:16 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip


 [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.

Regards, 
Ivan
 [2005-03-07 21:44 UTC] sniper@php.net
Bug fixed -> closed.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 01:01:28 2024 UTC