Vic*_*Dev 5 php linux ssl push-notification
我有一个PHP脚本位于路径中/var/www/vhosts/hostname/httpdocs/webservices,我有PHP脚本和.pem文件,我已经.pem在脚本中正确调用了文件,但是当我运行脚本时,我没有得到推送通知,而是我收到警告如:
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
Run Code Online (Sandbox Code Playgroud)
我仔细检查了脚本和.pem文件的所有路径,权限和所有者/组,仍未获得推送通知.
有任何建议,因为它是紧急的.
您可能会收到错误,因为您无意中尝试在运行脚本的目录中查找 .pem 文件,而不是相对于 .php 脚本文件查找它。
即使用
$location = "file.pem";
Run Code Online (Sandbox Code Playgroud)
而不是
$location = dirname(__FILE__)."/file.pem";
Run Code Online (Sandbox Code Playgroud)
您可以发布您的代码以便我们检查吗?