Edit report at https://bugs.php.net/bug.php?id=59851&edit=1

 ID:                 59851
 Updated by:         m...@php.net
 Reported by:        dh at cross-solutions dot se
 Summary:            HTTP Requests will intermittently timeout
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            pecl_http
 Operating System:   Arch Linux
 PHP Version:        5.3.6
 Block user comment: N
 Private report:     N

 New Comment:

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.




Previous Comments:
------------------------------------------------------------------------
[2011-07-16 11:38:35] 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-07-16 11:15:24] 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.


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=59851&edit=1

Reply via email to