4

I use paypal IPN class Quixotix-PHP-PayPal-IPN Now, I get notifcation from paypal to my ipn listener, and i activate the class, but i get the next error:

exception 'Exception' with message 'cURL error: [77] error setting certificate verify locations:
CAfile: /home/star1231/public_html/cert/api_cert_chain.crt
CApath: none' in /home/star1231/public_html/ipn.php:79
Stack trace:
#0 /home/star1231/public_html/ipn.php(175): IpnListener->curlPost('cmd=_notify-val...')
#1 /home/star1231/public_html/ipn.php(7): IpnListener->processIpn()
#2 {main}

I search about this error,

and i read that i need to install ca-certificates package, in this question: How do I deal with certificates using cURL while trying to access an HTTPS url?

i have no exprince in that staff, and i dont know where to run commands and what i need to download

so someone can please explain me how can i install the package in Cpanel on Godaddy?

Community
  • 1
  • 1
Nati323
  • 96
  • 1
  • 1
  • 9

2 Answers2

2

Check out: https://github.com/Quixotix/PHP-PayPal-IPN/issues/37

seting $listener->use_curl = FALSE; problem was solved

I am not a PHP dev, and I will be of little help assisting you with Linux, but you should be able to get this working by thoroughly reviewing the answers to these two questions:

  1. Paypal IPN Getting blank confirmation ( should be "VERIFIED" or "INVALID" )
  2. How do I deal with certificates using cURL while trying to access an HTTPS url?

The problem appears to be your Certificate Authority bundle, as meda writes: (source: https://stackoverflow.com/a/26260710/399124)

curl performs SSL certificate verification by default, using a "bundle" of Certificate Authority (CA) public keys (CA certs). The default bundle is named curl-ca-bundle.crt ... If you'd like to turn off curl's verification of the certificate, use the -k (or --insecure) option.

To verify that that is the problem, I would try is adding the -k or --insecure switch to the code in Quixotix-PHP-PayPal-IPN that's failing. Based on the stack trace, that's probably in /home/star1231/public_html/ipn.php(175).

Assuming that fixes it, we now need to figure out what's wrong with the bundle.

Does the file at /home/star1231/public_html/cert/api_cert_chain.crt even exist? If not, download it from (https://raw.githubusercontent.com/Quixotix/PHP-PayPal-IPN/master/cert/api_cert_chain.crt) and put it in the folder.

If you're still having trouble after you're sure the file is in the right place, you could have a security issue:

if there is no tls/certs folder: create one and change permissions using chmod 777 -R folderNAME

Community
  • 1
  • 1
David Schwartz
  • 1,956
  • 19
  • 28
1

OK, if someone need the solution ... First, Download api_cert_chain.crt

(if this link dosent work, just search in google "download api_cert_chain.crt" or something like that.)

Second, After you download this file put this file in "cert" Folder where your ipn listener is found. and you ready to go.

Nati323
  • 96
  • 1
  • 1
  • 9