I
I
Ivan Antonov2016-03-20 13:41:56
symfony
Ivan Antonov, 2016-03-20 13:41:56

The clear cache command does not work in cron. Why?

I execute the command:

php ~/www/site.ru/bin/console cache:clear --env=prod

if I specify the wrong path to php, error 127
if I specify the wrong path to console, the error says that the file was not found;
in other cases, it returns 255
I tried to run the file with echo 'Hello, World';.
Works! So the problem is in the Symfony Console?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Antonov, 2016-03-20
@antonowano

I ran the command:
I realized that the version does not match the required one.
After some googling, I figured out how to solve:

/opt/php55/bin/php ~/www/site.ru/bin/console cache:clear --env=prod

M
Maxim, 2016-03-20
@maxloyko

cron

* * * * * /usr/bin/php /var/www/symfony2/app/console your:command --option=123

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question