Symfony and error 500 on Apache server 1


While deploying an application realized with Symfony Framework, I had this horrible fatal error 500 by Apache, when trying to access the /web files

500 Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, [xxxx] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

A colleague found that by disabling /web/.htaccess the application was almost working. Wait… WHAT ?

After some research, I found this post http://www.particul.es/blog/index.php?post/Decortiquage-%3A-Le-htaccess-de-symfony by the team Particules explaining the the different lines in the .htaccess file in Symfony projects.

One line in particular in the .htaccess file was interesting because never seen before (in my short life):

Options +FollowSymLinks +ExecCGI

This line overrides Apache configuration adding the options to follow the symbolic links and to execute the CGI, even if there is no CGI script in Symfony… Hum. But since I didn’t have the rights to modify the server configuration, it was not working.

The solution for me was to remove this line, because the server was already following symbolic links, which I didn’t use by the way, and I don’t use CGI either.

And tadaaaa… Everything is fine now!

Fab
Latest posts by Fab (see all)

About Fab

Solutions Architect, I build great workflows for the news, media and broadcast industries. I play with data too.

Leave a comment

Your email address will not be published. Required fields are marked *

One thought on “Symfony and error 500 on Apache server

  • Carc

    Thanks very much for sharing that, I was at the edge of comitting murder.

    AS for me, the problem remained, and I solved it by additionnaly uncommenting the ” RewriteBase /” line