Using Magento community ver. Suddenly, without warning and without doing anything to the site (except maybe re-starting the server it runs on) I started getting orders paid for through Paypal Website Payments Standard stuck in 'Pending Payment' state. Paypal is sending the IPN (I can see that in my apache log) but Magento is sending back a 500 error. I thought it might be some weird parameter issue, but a Wireshark trace showed I wasn't even going to Paypal with the postback. It turns out that curl within Magento cannot resolve the paypal URL:

  • getaddrinfo(3) failed for www.paypal.com:443
  • Couldn't resolve host 'www.paypal.com'
  • Closing connection #0

whereas from the command line it works fine:

[root@server]# curl -V curl 7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.15.3 zlib/1.2.3 libidn/1.18 libssh2/1.4.2 Protocols: tftp ftp telnet dict ldap ldaps http file https ftps scp sftp Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz

[root@server]# curl --verbose www.paypal.com:443 * About to connect() to www.paypal.com port 443 (#0) * Trying connected * Connected to www.paypal.com ( port 443 (#0)

GET / HTTP/1.1 User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.15.3 zlib/1.2.3 libidn/1.18 libssh2/1.4.2 Host: www.paypal.com:443 Accept: /

  • Closing connection #0

Any help from anyone out there?

1 Answer 1


OK, problem solved. When my server starts up (Centos 6) it re-writes /etc/resolv.conf empty, so nothing can resolve outgoing DNS. Apache, and therefore mod_php, starts up and can't resolve anything, so it stays in this broken state. I come along and re-construct /etc/resolv.conf so that DNS lookups work again, but until I restart apache PHP still thinks the outside world doesn't exist. re-start apache and curl within Magento is able to connect to Paypal. Wonderful.

  • 2
    mark your answer as answered
    – Erfan
    Mar 24, 2015 at 1:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.