immobiliare / ApnsPHP

ApnsPHP: Apple Push Notification & Feedback Provider
BSD 3-Clause "New" or "Revised" License
1.44k stars 452 forks source link

Upgrade to PHP 5.5.24 crashes ApnsPHP #90

Open rwforsythe opened 9 years ago

rwforsythe commented 9 years ago

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 commented 9 years ago

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.

carlosgonzalez commented 9 years ago

Same issue here with PHP 5.5.24.

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

rwforsythe commented 9 years ago

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 commented 9 years ago

5.5.25 does indeed fix the issue.