As I wrote in the following article, I run into an unexpected situation when I try to run CakePHP3 on PHP7.2. https://qiita.com/21century_girl_/items/5be2606b3bfa98514952
Originally, I received a request to migrate the server, so I upgraded from *** PHP7.1 to PHP7.2 *** with a light feeling, "How can I upgrade the PHP version?"
php -v
This is the usual one. This is a command to check the version of php
command not found
It doesn't work.
php72 -v
This will work.
For the time being, as a simple response, it is posted in the following article, so I will omit it here https://qiita.com/21century_girl_/items/5be2606b3bfa98514952
I set it in /etc/cron.d as follows.
* * * * * root /var/www/html/***/bin/cake test
It's a normal cron setting. In the above case, it is an image of running TestShell.php in the shell of cakephp.
Failed to find a CLI version of PHP; falling back to system standard php executable /var/www/html/service/bin/cake: line 72: exec: php: not found
Apparently, looking at line 72 of the file, it seems that you are hitting the php command ...
for TESTEXEC in php php-cli /usr/local/bin/php
However, this error is appearing because the php command does not work.
Set as follows
PATH=/usr/local/bin:/sbin:/bin:/usr/bin:/usr/sbin/sendmail:/opt/remi/php72/root/usr/bin:/opt/remi/php72/root/usr/sbin
* * * * * root /var/www/html/***/bin/cake test
Now the php command is also available and the cakephp shell is running.
Recommended Posts