Server settings
Make sure that the server sends requests to the correct file in the root (app.php | app_dev.php). To do this, just stick to the beginning of the file app.php exit('true'); , open the root page of the site and everything will become clear: you saw true - the file is correct, you did not see - we are looking at the server settings. Server settings depend on whether you use apache or nginx. If apache , look at the root of the site .htaccess file. It should include, among other things, the string RewriteRule .? %{ENV:BASE}/app.php [L] RewriteRule .? %{ENV:BASE}/app.php [L] . If your file is original, everything should be fine there. For nginx , unfortunately, everything is a bit more complicated and the settings should be crammed with hands. Approximately, such a block should be present in your config so that requests to the root fall on app.php:
location ~ \.php$ { fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index app.php; include fastcgi_params; }
app.php
If requests come to the correct file, app.php, but the site is still opened in the dev-version - you need to check the contents of app.php. For example, this is how the code of this file looks like to me:
<?php use Symfony\Component\ClassLoader\ApcClassLoader; use Symfony\Component\HttpFoundation\Request; $loader = require_once __DIR__.'/../app/bootstrap.php.cache'; $apcLoader = new ApcClassLoader(strtolower($_SERVER['HTTP_HOST']) . "_", $loader); $loader->unregister(); $apcLoader->register(true); require_once __DIR__.'/../app/AppKernel.php'; $kernel = new AppKernel('prod', false); $kernel->loadClassCache(); $request = Request::createFromGlobals(); $response = $kernel->handle($request); $response->send(); $kernel->terminate($request, $response);
Notice the line $kernel = new AppKernel('prod', false); In the context of the problem, it is the most important. This is where the environment is set by the first argument and the second debug . Here you should have exactly these values.
In addition, you probably need to run the command to run the prod-environment
php ./app/console assetic:dump
which generates all the necessary statics. But here the situation is ambiguous, perhaps your system is configured to generate static on the fly.