Updated Laravel 5.3 to Laravel 5.4 using this container https://github.com/shin1x1/docker-laravel-on-php7-apache

PHP changed from 5.X to 7. In the crown there was such a task

* * * * * php /var/www/laravel/artisan schedule:run >>/dev/null 2>&1 

On the previous build, everything worked fine, but now it has stopped

The command itself, if run from SSH

 php /var/www/laravel/artisan schedule:run >>/dev/null 2>&1 

works fine.

If you redirect error output from the crown to a file, for example

  * * * * * php /var/www/laravel/artisan schedule:run > /etc/log/faillog 

So in the file we get this

 /bin/sh: 1: php: not found 

The question is why does cron not see PHP and where to dig?

    1 answer 1

    /bin/sh: 1: php: not found

    Obviously, you must either specify the full path to the php program, which you can find out, for example, with this command:

     $ which php 

    or add to the beginning of the file with a cron -task override the value of the PATH environment variable:

     PATH=значение 

    the desired value can be found, for example, with the following command:

     $ echo $PATH 

    ps these commands, of course, must be executed inside the container.

    • I could not get to this company for a long time, but everything worked out - Alexey Shatrov