I am using the apns php server provided at https://code.google.com/p/apns-php/.
I\'ve have set up th push notification certificate but my code still throws an error
The most likely explanation is that you are sending a push notification with a sandbox device token to the production APNS server.
Either you are using an old device token that was sent to your server by your app while you were testing it in the sandbox environment, or your app is still signed with a development provisioning profile, and is still receiving sandbox device tokens from the APNS service.
My answer assumes that you are using a device token that originated from the APN service, and not some dummy token you created yourself .
I suggest you check the provisioning profile to see what value appear for the aps entitlement. I also suggest you clear your db from any old device tokens.