Note that there are some explanatory texts on larger screens.

plurals
  1. POPaypal - CURL response is 0 in a new server (connection time out), it's ok in the old server
    primarykey
    data
    text
    <p>I'm trying to connect to Paypal Sandbox from a new server. If I test the code in my local computer (using XAMPP) it works fine. Also, if I test the code in my old server, it works ok too (same PHP version and libraries, and the new server should have the same configuration as the old (although I'm starting to doubt it...). </p> <p>I redirect the CURL output to a file and this is what I get (similar output in curl_error()):</p> <pre><code>About to connect() to svcs.sandbox.paypal.com port 443 (#0) Trying 173.0.82.89... * Connection timed out couldn't connect to host Closing connection #0 </code></pre> <p>This is the output of curl_getinfo():</p> <pre><code>[url] =&gt; https://svcs.sandbox.paypal.com/AdaptivePayments/Pay?actionType=PAY... [http_code] =&gt; 0 [header_size] =&gt; 0 [request_size] =&gt; 0 [filetime] =&gt; -1 [ssl_verify_result] =&gt; 0 [redirect_count] =&gt; 0 [total_time] =&gt; 0 [namelookup_time] =&gt; 0.058702 [connect_time] =&gt; 0 [pretransfer_time] =&gt; 0 [size_upload] =&gt; 0 [size_download] =&gt; 0 [speed_download] =&gt; 0 [speed_upload] =&gt; 0 [download_content_length] =&gt; 0 [upload_content_length] =&gt; 0 [starttransfer_time] =&gt; 0 [redirect_time] =&gt; 0 </code></pre> <p>This is the PHP code:</p> <pre><code>$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $URL); curl_setopt($ch, CURLOPT_VERBOSE, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPHEADER , array( 'X-PAYPAL-SECURITY-USERID: '.$api_userid , 'X-PAYPAL-SECURITY-PASSWORD: '.$api_pass , 'X-PAYPAL-SECURITY-SIGNATURE: '.$api_signature , 'X-PAYPAL-APPLICATION-ID: '.$api_appid , 'X-PAYPAL-REQUEST-DATA-FORMAT: NV' , 'X-PAYPAL-RESPONSE-DATA-FORMAT: NV' ) ); $response = curl_exec($ch); </code></pre> <p>I think the problem points to a server configuration issue, but I'm a little lost in wich way I have to look: PHP configuration, Apache, firewall, ... ¿any ideas?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload