PHP cURL working locally, error 77 on AWS server PHP cURL working locally, error 77 on AWS server curl curl

PHP cURL working locally, error 77 on AWS server


I have the same error on amazon AMI linux.

I Solved by setting curl.cainfo on /etc/php.d/curl.ini

check my curl.inihttps://gist.github.com/reinaldomendes/97fb2ce8a606ec813c4b


Answering my own question after 2 days of debugging. After playing with compiling everything one by one, I realized that after the last update in the Amazon Linux server - caused by the heartbleed issue, there was a problem with NSS, package manager couldn't update it because of some broken dependencies.

The one solution was to re-compile PHP with cURL using openSSL instead of NSS. Before doing that and spend hours (as also not relying on the ease of package management), I created a fresh Amazon Linux server to check if they had updated the package management and NSS worked in the new AMIs. And they had. Popped a new instance, did a yum update before anything else, and NSS was the first to be updated.

Tried the above code and worked. So, now I'm moving all the codebase to the new instance, switching EIP to the new instance and all good.


Ends up, stopping and starting Apache was required for me.

I couldn't believe it myself. On my AWS EC2, I had yum updated everything and still it wasn't working. This was trying to cUrl post to authorize.net. Ends up, get this, thanks to @JimOHalloran restart wasn't doing it.

  • apachectl graceful (no)
  • apachectl restart (no)
  • apachectl stop
  • apachectl start

BAM! Problem fixed - I spent 3+ hours today banging my head and reading every page online about this problem. I have NO CLUE what that's different than a hard restart but it did. Apparently something else (Curl? OpenSSL?) got restarted too then.