cancel
Showing results for 
Search instead for 
Did you mean: 

PayPal NVP CURL connection error #7: /vendor/magento/module-paypal/Model/Api/Nvp.php

SOLVED
Highlighted

PayPal NVP CURL connection error #7: /vendor/magento/module-paypal/Model/Api/Nvp.php

Hey guys,

 

I am running Magento 2.3.5p1 on CentOS 8 and I am getting the following exception when I click checkout with PayPal. 

 

[2020-06-06 20:43:34] main.CRITICAL: PayPal NVP CURL connection error #7:  {"exception":"[object] (Exception(code: 0): PayPal NVP CURL connection error #7:  at /var/www/html/vendor/magento/module-paypal/Model/Api/Nvp.php:1215)"} []

 

I have checked to make sure I have the correct version of CURL

 

curl 7.61.1 (x86_64-redhat-linux-gnu)

I am having a similar issue trying to get USPS to work as a shipping carrier:

 

POST magentowebsite.com/index.php/rest/default/V1/guest-carts/szvNnGiFGE2eeRTxVX7n5N32pnr7kyfX/estimate-shipping-methods 500
[2020-05-30 20:55:26] main.CRITICAL: Report ID: webapi-5ed2c83e06062; Message: cURL error 7:  (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) {"exception":"[object] (Exception(code: 0): Report ID: webapi-5ed2c83e06062; Message: cURL error 7:  (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) at /var/www/html/vendor/magento/framework/Webapi/ErrorProcessor.php:208, Magento\\Framework\\HTTP\\AsyncClient\\HttpException(code: 0): cURL error 7:  (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) at /var/www/html/vendor/magento/framework/HTTP/AsyncClient/GuzzleWrapDeferred.php:88, GuzzleHttp\\Exception\\ConnectException(code: 0): cURL error 7:  (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) at /var/www/html/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:200)"}

I have looked on the forums and stack overflow and tried many of the fixes like changing my base URL for USPS to https and updating my curl. I also tried disabling the new CSP module exclusive to 2.3.5. None of these has fixed my issues. 

Would anyone please kindly point me in the right direction? 

 

Thanks so much!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: PayPal NVP CURL connection error #7: /vendor/magento/module-paypal/Model/Api/Nvp.php

This is the solution for anyone facing the same issue.

 

Since the newer versions of CentOS all come with SELinux enabled, we need to adjust the httpd can network connect boolean so that curl can be used.

 

/usr/sbin/setsebool httpd_can_network_connect 1

View solution in original post

2 REPLIES 2
Highlighted

Re: PayPal NVP CURL connection error #7: /vendor/magento/module-paypal/Model/Api/Nvp.php

@jiautdgmai2d19 

 

Can you upgrade it to latest version of curl? as latest version of curl is 7.70.0.

 

Apart from that I can see this issue have already created in github to check:

https://github.com/magento/magento2/issues/28597

 

Meanwhile you can check, Outgoing Connections which web hosting company can block it to connect with paypal. You can check your security group too that also sometime can block it.

Manish Mittal
https://www.manishmittal.com/
Highlighted

Re: PayPal NVP CURL connection error #7: /vendor/magento/module-paypal/Model/Api/Nvp.php

This is the solution for anyone facing the same issue.

 

Since the newer versions of CentOS all come with SELinux enabled, we need to adjust the httpd can network connect boolean so that curl can be used.

 

/usr/sbin/setsebool httpd_can_network_connect 1

View solution in original post