0

My PHP application intermittently returns a 500 internal server error on random requests for a specific client.

But it seems like the request is being processed on my side (database entry created as a result of this request), and the logs don't show any errors at all related to these requests.

I really can't figure out why this is happening or where to start debugging this.

I've checked the nginx logs and they don't have anything either.

All they see is {"error": true, "message": "Internal Server Error"}. Can I ask the client to log this failure in any way to add more light to this?

Completely lost here, so I appreciate any help at all. Thanks.

fractal5
  • 2,034
  • 4
  • 29
  • 50
  • A 500 error is a generic error message and covers pretty much every single thing that can go wrong with a PHP script. Check your server error logs to find out the exact error message. – aynber Jan 20 '23 at 20:45
  • If PHP is generating a 500 error then it will attempt to log the underlying cause. Ensure your logging is correctly configured and take it from there. Without more debugging info I doubt there's much we can do to help. – Tangentially Perpendicular Jan 20 '23 at 20:46
  • What I'm confused by is how is PHP returning a 500 yet completing the request successfully? – fractal5 Jan 20 '23 at 20:53
  • It can't be. A 500 indicates that the code crashed. But maybe it crashed quite near the end of the script, after it had completed most of the tasks – ADyson Jan 20 '23 at 22:23

0 Answers0