Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony 3.1: error when requesting app_dev.php or app.php

Tags:

apache

symfony

Im getting this when requesting sorial/app_dev.php:

Not Found

The requested URL /app_dev.php/ was not found on this server.

And when requesting sorial/app.php:

unregister(); $apcLoader->register(true); */ $kernel = new AppKernel('prod', false); $kernel->loadClassCache(); //$kernel = new AppCache($kernel); // When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter //Request::enableHttpMethodParameterOverride(); $request = Request::createFromGlobals(); $response = $kernel->handle($request); $response->send(); $kernel->terminate($request, $response);

Im on Ubuntu 14.04 and Apache 2.4

EDIT: This is my virtual host:

<VirtualHost *:80>
    ServerName sorial
    #ServerAlias sorial.es
    DocumentRoot /var/www/sorial/web
        DirectoryIndex app.php
    #SetEnv SYMFONY__DATABASE__PASSWORD jander
    <Directory /var/www/sorial/web/>
        # Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        #Order allow,deny
        #allow from all
        Require all granted
        FallbackResource /index.php
        # BEGIN EXPIRES
        <IfModule mod_expires.c>
            ExpiresActive On
            ExpiresDefault "access plus 10 days"
            ExpiresByType text/css "access plus 1 week"
            ExpiresByType text/plain "access plus 1 month"
            ExpiresByType image/gif "access plus 1 month"
            ExpiresByType image/png "access plus 1 month"
            ExpiresByType image/jpeg "access plus 1 month"
            ExpiresByType application/x-javascript "access plus 1 month"
            ExpiresByType application/javascript "access plus 1 week"
            ExpiresByType application/x-icon "access plus 1 year"
        </IfModule>
        # END EXPIRES
    </Directory>
</VirtualHost>

And my document root is at /var/www/sorial/web.

The truth is I have the same problem for the rest of my sites. The problem started when I try to disable/enable env_mod using a2dismod env, since when adding the variable SetEnv (as you can see in my virtual host) I was getting

Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.

when restarting apache.

like image 631
ziiweb Avatar asked Oct 08 '16 01:10

ziiweb


1 Answers

I finally solved my problem installing php5 and libapache2-mod-php5 like this: sudo apt-get install php5 libapache2-mod-php5

like image 97
ziiweb Avatar answered Oct 30 '22 11:10

ziiweb