I want to send APN (Apple Push Notification) from a PHP script. My PHP script works fine, and I get a notification on the iphone device, as well as when sending from localhost, but when I upload the same script with the same .pem file to the shared server , it returns an error ...
Warning: stream_socket_client() [function.stream-socket-client]: unable to connect to ssl://gateway.push.apple.com:2195 (Connection refused) in /mypath/SendPushNotification.php on line 28 Failed to connect: 111 Connection refused
From some source, I learn that for sending the APN port 2195 must be open, which is impossible in terms of a common server. So I tried to use a dedicated server, and it works fine, and I get a notification on the device. I tried very hard to find a solution for the shared server, but did not find any solution.
My question is: is it possible to send an APN without opening port 2195 from a shared server? if yes give some recommendations.
source share