I just try to deploy to production a Symfony (3.3.5) project for the first time and I am in a little trouble.
MySQL is installed and running on the server, Symfony can connect to it.
Apache2 and PHP are running too. (And simple PHP files like a echo "hello world"
work as expected).
I have two points:
First: when I try to access http://example.com/web/app.php the "page isn't working" (this is the Chrome error message) with error code 500. Same thing for any other URL like http://example.com/web/app.php/login.
Second: Why do I still have to use routes with /web/app.php
(if I don't use it, the server show me a directory explorer of the web server) whereas my .htaccess file looks like this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ web/$1 [QSA,L]
</IfModule>
And my /etc/apache2/sites-available/example.com.conf
file is:
<VirtualHost *:80>
ServerAdmin mymail@gmail.com
ServerName example.com
ServerAlias dev.gepacte.com
DocumentRoot /var/www/example.com/public_html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory "/var/www/example.com/public_html">
<IfModule sapi_apache2.c>
php_admin_flag engine on
</IfModule>
<IfModule mod_php5.c>
php_admin_flag engine on
</IfModule>
#If one of the following lines is uncommented, the apache2 serve won't restart.
#DirectoryIndex app.php
#Options -Indexes
#AllowOverride All
#Allow from All
</Directory>
</VirtualHost>
Of course, my symfony project is located in /var/www/example.com/public_html
EDIT:
My /var/log/apache2/access.log
file:
80.215.95.207 - - [07/Nov/2017:18:22:44 +0100] "GET /web/app.php/ HTTP/1.1" 500 716 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36"
And the /var/log/apache2/error.log
file:
[Tue Nov 07 18:24:20.542808 2017] [mpm_prefork:notice] [pid 17564] AH00169: caught SIGTERM, shutting down
[Tue Nov 07 18:24:20.723226 2017] [mpm_prefork:notice] [pid 22562] AH00163: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Tue Nov 07 18:24:20.723301 2017] [core:notice] [pid 22562] AH00094: Command line: '/usr/sbin/apache2'