Error with APNS Server using PHP

1

I created a small APNS Server using PHP, using an older version of Xampp. But when I was using the push file in a current version, I got the error as per the image:

The error line which is referenced above is this:

// Servidor de produção0
$fp = stream_socket_client( 'ssl://gateway.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx);

I think the stream_socket_client function is outdated, as I'm not a PHP expert, I wonder if this is the problem, and if so, how could I override or update this function.

    
asked by anonymous 22.01.2015 / 00:24

1 answer

1

I ran some tests:

  • Using Xampp 5.6 - > You have reported the error reported in the question
  • Using the Mac Console (native PHP with version 5.5) - > It worked normally
  • Using Xampp 5.5 - > It also worked normally.

    I believe that some configuration or update in Xampp 5.6 is affecting access to the * .pem file on disk, making it impossible to create an APNS connection.

    If anyone knows this problem in version 5.6 and knows the solution thank you for commenting or complementing this solution I found.

Thank you all!

    
22.01.2015 / 16:33