A
A
Alexander Strelov2012-12-18 11:26:18
symfony
Alexander Strelov, 2012-12-18 11:26:18

How to run a project on Symfony2?

The project is implemented on Symfony 2 and everything works fine in the dev environment, i.e. when requesting /app_dev.php, but when trying to execute a request in the prod environment for /app.php, an exception is thrown:

1/1 RuntimeException: The Expires HTTP header is not parseable (-1).
in /www/app/cache/prod/classes.php line 2576
at HeaderBag->getDate('Expires') in /www/app/cache/prod/classes.php line 4181
at Response->getExpires() in /www /app/cache/prod/classes.php line 4209
at Response->getMaxAge() in /www/app/cache/prod/classes.php line 4236
at Response->getTtl() in /www/vendor/symfony/symfony /src/Symfony/Component/HttpKernel/HttpCache/EsiResponseCacheStrategy.php line 45
at EsiResponseCacheStrategy->add(object(Response)) in /home/www/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/HttpCache .php line 207
at HttpCache->handle(object(Request)) in /home/www/web/app.php line 22

Tried clearing cache, running assetic:dump --env=prod --no-debug and assets:install no result. This happened after updating the project and vendors. Everything works fine on the local machine. What needs to be done to run the prod environment on the server? Tell me which way to dig.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
alexeyshockov, 2012-12-20
@alexeyshockov

Turn off AppCache in web/app.php. An error with ESI, and if it is incomprehensible to you, then you most likely do not use this feature.

S
Sergey, 2012-12-18
Protko @Fesor

You clearly see from the error message and stacktrace that the problem is with HTTP caching. You have to dig in this direction. As for clearing the cache, I remember that when updating vendors, this all happens only for the dev environment.

S
stnw, 2012-12-18
@stnw

As already written above, try refreshing the cache:
php app/console cache:clear --env=prod

J
JekaRu, 2012-12-18
@JekaRu

Did you update on the vendor server via update?
If yes, then try to do it through install, it should install exactly the versions that the developer had and are registered in the (deps|composer).lock file.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question