php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59851 HTTP Requests will intermittently timeout
Submitted: 2011-07-16 11:15 UTC Modified: 2012-02-21 13:30 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: dh at cross-solutions dot se Assigned:
Status: No Feedback Package: pecl_http (PECL)
PHP Version: 5.3.6 OS: Arch Linux
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:
Package:
Bug Type:
Summary:
From: dh at cross-solutions dot se
New email:
PHP Version: OS:

 

 [2011-07-16 11:15 UTC] dh at cross-solutions dot se
Description:
------------
I create a HttpRequest object for an SSL site (paypal) with METH_POST method.
Every hour or so I have to restart the apache server because all I get is "SSL request reached timeout" in my $message->send(). The length of the timeout does not matter (I've increased it to minutes with setOptions(), it just takes longer but it still times out). 

The funny thing is that while the request times out from PHP, I can make the exact same one with curl in a shell just fine, which suggests there is a problem with the php module.


Reproduce code:
---------------
    $message = new HttpRequest( "https://svcs.sandbox.paypal.com/AdaptivePayments/Preapproval", HttpRequest::METH_POST );
    $message->addHeaders( 
        array( 
        	"X-PAYPAL-SECURITY-USERID" => "<replace_with_userid>", // I have removed our company's user ID here
        	"X-PAYPAL-SECURITY-PASSWORD" => "<replace with password>", // And password
            "X-PAYPAL-SECURITY-SIGNATURE" => "<replace with signature>", // And signature
            "X-PAYPAL-REQUEST-DATA-FORMAT" => "NV",
            "X-PAYPAL-RESPONSE-DATA-FORMAT" => "NV",
            "X-PAYPAL-APPLICATION-ID" => "<replace with app ID>" ) );
    $message->setPostFields( "bogus" );
    try 
    {
        $response = $message->send();
        if ( $response->getResponseCode() == 200 )
        {
             echo "Woohoo!";
        }
    }
    catch ( HttpException $exception )
    {
        echo "$exception\n";
    }


Expected result:
----------------
I get a response back from the server every time I make the request.

Actual result:
--------------
After a number of successful requests, I only get timeouts until I restart the apache server.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-07-16 11:38 UTC] dh at cross-solutions dot se
The exact exception is:

exception 'HttpInvalidParamException' with message 'Empty or too short HTTP message: ''' in /srv/http/food/request_preapprove_key.php:0 inner exception 'HttpRequestException' with message 'Timeout was reached; Connection time-out (https://svcs.sandbox.paypal.com/AdaptivePayments/Preapproval)' in /srv/http/food/request_preapprove_key.php:81 Stack trace: #0 /srv/http/food/request_preapprove_key.php(0): HttpRequest->send() #1 {main}
 [2011-10-19 14:39 UTC] mike@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.


 [2011-10-19 14:39 UTC] mike@php.net
-Status: Open +Status: Feedback
 [2012-02-21 13:30 UTC] mike@php.net
-Status: Feedback +Status: No Feedback
 [2012-02-21 13:30 UTC] mike@php.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 "Open". Thank you.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 19:01:29 2024 UTC