I have a PHP script on server which, generally...
- Receives url-encoded data via POST from Service A
- Makes adjustments to the data for Service B
- Submits to Service B
This works great except that every so often, Service A reports that the script 404'd (was not found).
I am trying to figure out two things:
- Why would a 404 error occur if the script exists and is accessible?
- I believe the issue is related to a timeout somewhere in the script. Is there a way that I can avoid the 404 error and perhaps log some helpful messages, like in this post?
Thank you!
It looks like you are using some naked code base (i.e. some procedural or poorly architected object oriented solution). With acknowledged PHP frameworks like Zend or Symfony, you could define error handlers for such situations and given the sent and received data handle it appropriately like retrying that particular request or, with a queue system being employed, reschedule the job.
An advice for you, don't care about the why. Prepare your app for the what-when.