Home » Php » php – Yii2 command controller function not executing in crontab in docker container

php – Yii2 command controller function not executing in crontab in docker container

Posted by: admin February 25, 2020 Leave a comment

Questions:

I have a yii2 application running in a docker container. Basically I have a command controller which makes inserts data into the table. When I docker exec -it container bash into the container and run /usr/local/bin/php /app/yii target/test it works. I can see new data entered into the database. However when i set up crontab with */1 * * * * /usr/local/bin/php /app/yii target/test which is to run every minute for test purpose, i don’t see any database entry no any error. Anyone encountered this before and what could be the issue

How to&Answers: