ApnsPHP icon indicating copy to clipboard operation
ApnsPHP copied to clipboard

Upgrade to PHP 5.5.24 crashes ApnsPHP

Open rwforsythe opened this issue 9 years ago • 4 comments

Just upgraded to PHP 5.5.24, and ApnsPHP stops working. It now sends the notification, but hangs in the send function consuming all server resources on the thread.

No errors (apart from timezone) and this is the log output from sample_push.php: Sat, 16 May 2015 19:15:22 +0000 ApnsPHP[15659]: INFO: Trying tls://gateway.push.apple.com:2195... Sat, 16 May 2015 19:15:22 +0000 ApnsPHP[15659]: INFO: Connected to tls://gateway.push.apple.com:2195. Sat, 16 May 2015 19:15:22 +0000 ApnsPHP[15659]: INFO: Sending messages queue, run #1: 1 message(s) left in queue. Sat, 16 May 2015 19:15:22 +0000 ApnsPHP[15659]: STATUS: Sending message ID 1 custom identifier: Message-Badge-31: 120 bytes.

Then it hangs, consuming all resources until killed. The notification is received by the device.

If I comment out "$push->send();" from sample_push.php, my log file reads (and no hang): Sat, 16 May 2015 21:20:31 +0200 ApnsPHP[15983]: INFO: Trying tls://gateway.push.apple.com:2195... Sat, 16 May 2015 21:20:31 +0200 ApnsPHP[15983]: INFO: Connected to tls://gateway.push.apple.com:2195. Sat, 16 May 2015 21:20:31 +0200 ApnsPHP[15983]: INFO: Disconnected.

[Note: was running PHP v5.5.22 just fine before the upgrade.]

rwforsythe avatar May 16 '15 19:05 rwforsythe

Just noticed that this is a dup of this thread: https://github.com/immobiliare/ApnsPHP/issues/84

Per that thread, the issue is a problem with PHP v5.5.23 and v5.5.24 and should be fixed in v5.5.25.

rwforsythe avatar May 17 '15 14:05 rwforsythe

Same issue here with PHP 5.5.24.

Should I upgrade my PHP version? Is the @rwforsythe solution working for anyone?

carlosgonzalez avatar May 21 '15 04:05 carlosgonzalez

Allegedly 5.5.25 fixes this issue, but I have seen no definitive answer. All workarounds seem to allow core functionality, but errors are not handled correctly.

rwforsythe avatar May 21 '15 06:05 rwforsythe

5.5.25 does indeed fix the issue.

rwforsythe avatar May 26 '15 17:05 rwforsythe