Reputation: 493
I have set up a new Symfony3 project locally, but when I'm getting something wrong in my code the error is not displayed, only
The server returned a "500 Internal Server Error"
Is any other setting is required to display the exact error message on page?
Upvotes: 1
Views: 961
Reputation: 974
Read your server service logs (e.g. tail -f /var/log/nginx/error.log
) because 500 can be triggered by error on each level of your architecture (low on the server side or high in the app).
If you have errors in the application, very helpful would be set debug=true
to the AppKernel (so you can just launch your application via app_dev.php instead of default app.php).
Upvotes: 0
Reputation: 236
A 500 error could be caused earlier in the request lifecycle than your application code, so it may not be possible to report further information "on page" depending on what service is failing. Those services may have their own settings for further error reporting in the response body; however, logs are typically the best place to look for services outside of the application code.
Turning on error reporting for your application as well, which, as @miikes suggested, in a standard symfony app can be done by using /app_dev.php instead of /app.php, could potentially provide more information if the error is in your application code.
Upvotes: 0
Reputation: 974
Try to call app_dev.php
instead of app.php
, so in your web browser enter the yourdomain.dev/app_dev.php
instead of yourdomain.dev
.
Upvotes: 1