Debugging a 404 error for an existing page

1.5k views Asked by At

I have a PHP script on server which, generally...

  1. Receives url-encoded data via POST from Service A
  2. Makes adjustments to the data for Service B
  3. 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:

  1. Why would a 404 error occur if the script exists and is accessible?
  2. 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!

1

There are 1 answers

2
marekful On BEST ANSWER

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.