向 iOS 测试设备发送推送通知时出现 PHP 错误


PHP error when sending Push Notification to iOS test device

我按照教程(http://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1#comments)完成了所有配置文件和iOS代码。我将 ck.pem 和设备令牌正确复制到 PHP 文件中。但是我得到了这个奇怪的错误:

➜  SimplePush  php simplepush.php simplepush.php
PHP Warning:  PHP Startup: pdo_pgsql: Unable to initialize module
Module compiled with module API=20100525
PHP    compiled with module API=20121212
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: pgsql: Unable to initialize module
Module compiled with module API=20100525
PHP    compiled with module API=20121212
These options need to match
 in Unknown on line 0
Connected to APNS
Message successfully delivered
➜  SimplePush

它显示连接正常并且交付成功,但我的测试设备没有收到通知。我猜关于"pdo_pgsql"和"pgsql"的错误。我只是在我的本地机器上测试它,与数据库无关。我不知道如何解决这个问题。任何帮助将不胜感激!

这表明您需要使用相同的 PHP 版本重新编译模块和 PHP。 您是否碰巧通过brew安装了一个或另一个? 重新构建 PHP 和模块将允许您继续。