I have a PHP script located in path like /var/www/vhosts/hostname/httpdocs/webservices
, I have both PHP script and .pem
files there, and I have called the .pem
file in the script properly, but still when I run the script , I don't get push notification , instead i get warnings such as:
Warning: stream_socket_client() [function.stream-socket-client]: Unable to set local cert chain file `ck_push_test.pem'; Check that your cafile/capath settings include details of your certificate and its issuer in /var/www/vhosts/ipartyapps.com/httpdocs/webservices/testPush.php on line 12
Warning: stream_socket_client() [function.stream-socket-client]: failed to create an SSL handle in /var/www/vhosts/ipartyapps.com/httpdocs/webservices/testPush.php on line 12
Warning: stream_socket_client() [function.stream-socket-client]: Failed to enable crypto in /var/www/vhosts/ipartyapps.com/httpdocs/webservices/testPush.php on line 12
Warning: stream_socket_client() [function.stream-socket-client]: unable to connect to ssl://gateway.push.apple.com:2195 (Unknown error) in /var/www/vhosts/ipartyapps.com/httpdocs/webservices/testPush.php on line 12
Failed to connect 0
I double checked everything path, permissions and owner/group of both script and .pem
files, still not getting push notification.
Possibly you are getting the error because you are unintentionally trying to find the .pem file in the directory you are running the script from rather than finding it relative to the .php script file.
i.e. using
$location = "file.pem";
rather than
$location = dirname(__FILE__)."/file.pem";
Can you post your code so we can check it?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With