I copied the apns-php on xampp htdocs.
Placed server_cerificates_bundle_sandbox.pem file near to
sample_push.php, made sure the name is correct in php file.
I also placed entrust .pem file.
I have created an iOS application,which connects to urbanairship and
brings me a token.
I am using that token in following line as parameter.
$message = new ApnsPHP_Message(');
When I launch sample_push.php from browser, I get following
Thu, 01 Dec 2011 09:30:04 +0000 ApnsPHP[16958]: INFO: Trying
ssl://gateway.sandbox.push.apple.com:2195... Thu, 01 Dec 2011 09:30:04
+0000 ApnsPHP[16958]: ERROR: Unable to connect to 'ssl://
gateway.sandbox.push.apple.com:2195': (0) Thu, 01 Dec 2011 09:30:04
+0000 ApnsPHP[16958]: INFO: Retry to connect (1/3)... Thu, 01 Dec 2011
09:30:05 +0000 ApnsPHP[16958]: INFO: Trying ssl://gateway.sandbox.push.apple.com:2195...
Thu, 01 Dec 2011 09:30:06 +0000 ApnsPHP[16958]: ERROR: Unable to
connect to 'ssl://gateway.sandbox.push.apple.com:2195': (0) Thu, 01
Dec 2011 09:30:06 +0000 ApnsPHP[16958]: INFO: Retry to connect
(2/3)... Thu, 01 Dec 2011 09:30:07 +0000 ApnsPHP[16958]: INFO: Trying
ssl://gateway.sandbox.push.apple.com:2195... Thu, 01 Dec 2011 09:30:08
+0000 ApnsPHP[16958]: ERROR: Unable to connect to 'ssl://
gateway.sandbox.push.apple.com:2195': (0) Thu, 01 Dec 2011 09:30:08
+0000 ApnsPHP[16958]: INFO: Retry to connect (3/3)... Thu, 01 Dec 2011
09:30:09 +0000 ApnsPHP[16958]: INFO: Trying ssl://gateway.sandbox.push.apple.com:2195...
Fatal error: Uncaught exception 'ApnsPHP_Exception' with message
'Unable to connect to 'ssl://gateway.sandbox.push.apple.com:2195':
(0)' in /Applications/XAMPP/xamppfiles/htdocs/iOSNotification/ApnsPHP/
Abstract.php:352 Stack trace: #0 /Applications/XAMPP/xamppfiles/htdocs/
iOSNotification/ApnsPHP/Abstract.php(295): ApnsPHP_Abstract-
>_connect() #1 /Applications/XAMPP/xamppfiles/htdocs/iOSNotification/
sample_push.php(42): ApnsPHP_Abstract->connect() #2 {main} thrown in /
Applications/XAMPP/xamppfiles/htdocs/iOSNotification/ApnsPHP/
Abstract.php on line 352
I've checked that I am able to telnet on my teminal to apple sandbox
apns on 2195 port.
I also checked that, xampp has openssl enabled.
What am I doing wrong, any help is much appreciated.
-Pahup