Search code examples
phpapple-push-notificationsapns-php

Where should I put the .pem files for ApnsPHP to work?


I have my two files entrust_root_certification_authority.pem and server_certificates_bundle_sandbox.pem, but I'm not sure where I should put them. I get this error :

Fatal error: Uncaught exception 'ApnsPHP_Exception' with message 'Unable to read certificate file 'server_cerificates_bundle_sandbox.pem'' 

Solution

  • This example contains an error, the name of file in sample_push.php is wrong 'server_cerificates_bundle_sandbox.pem', correct name is 'server_certificates_bundle_sandbox.pem'. Only for tests, you can put pem files in root directory of your apns site. I had the same problem, but now it works fine.

    Good luck.