vagrant v12 cron problem

Just spent what seemed like an eternity trying to get CRON working on a V12 vagrant box.

Turns out the vagrant box image has php 8.0 & 8.1 installed on it, and the CLI (i.e. CRON) will use 8.1 by default - and that crashes cron.php if you run it from the terminal. As sugar is running with 8.0

So the solution is to setup cromtab with 8.0 forced i.e. "php8.0 -f cron.php" - the rest of the line is the same

 

Parents
  • The best way is to make sure the /usr/bin/php link points to the correct php you want to use by doing "sudo update-alternatives --config  php" and select the one you want. Also you might want to verify that cron is using the correct php.ini, I solved this by putting into crontab this way

    * * * * * cd /var/www/html/sugar; /usr/bin/php -c /etc/php/8.0/apache2/php.ini -f cron.php > /dev/null 2>&1

Reply
  • The best way is to make sure the /usr/bin/php link points to the correct php you want to use by doing "sudo update-alternatives --config  php" and select the one you want. Also you might want to verify that cron is using the correct php.ini, I solved this by putting into crontab this way

    * * * * * cd /var/www/html/sugar; /usr/bin/php -c /etc/php/8.0/apache2/php.ini -f cron.php > /dev/null 2>&1

Children