Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug 500 Error in Symfony 2

Tags:

I am struggling with Symfony 2 error reporting because I can't find out what really is happing when a 500 Error is triggered.

I have XDebug correctly installed, but it seems like Symfony rules everything.

The custom pages just says:

Oops! An Error Occurred  The server returned a "500 Internal Server Error".  Something is broken. Please e-mail us at [email] and let us know what you were doing when this error occurred. We will fix it as soon as possible. Sorry for any inconvenience caused. 

That's pretty much funny! Something is broken, but, the fact is that I need to fix my code, but can't know what or where it is the problem! And sure, If I send an email for the Symfony team will they be able to solve my problem once I not even know what to say them?

Some clue on what I am missing here?

like image 387
Gilberto Albino Avatar asked Sep 02 '13 15:09

Gilberto Albino


People also ask

How do I force a 500 internal server error?

Delete your browser's cookies. You can correct some 500 Internal Server Error issues by deleting the cookies associated with the site on which you're getting the error. After removing the cookie(s), restart the browser and try again. Troubleshoot as a 504 Gateway Timeout error instead.

How do you fix 500 Internal server error There is a problem with the resource you are looking for and it Cannot be displayed?

There is a problem with the resource you are looking for, and it cannot be displayed. The first solution to a 500 internal server error is to refresh the page. If the error persists, you may try clearing the cookies, deactivating faulty plugins or themes, fixing the . htaccess file, or contacting your hosting provider.


1 Answers

First, look at the logs in app/logs depending on your environment — dev.log for development, prod.log for production, etc.

If the code crashes before Symfony has a chance to run, check the logs of your web server — e.g. nginx.

like image 182
Elnur Abdurrakhimov Avatar answered Sep 18 '22 00:09

Elnur Abdurrakhimov