Moodle 3.11 - cron.php on Ubuntu 22.04 not running

Re: Moodle 3.11 - cron.php on Ubuntu 22.04 not running

by Frank Walter -
Number of replies: 0
I have a switch to change the PHP CLI version, I have it in my .bashrc (in .bash_functions, actually, linked from .bashrc):

    # 2023-03-23: die CLI PHP Version umschalten, siehe:
# https://gridpane.com/kb/setting-the-cli-php-version/
phpcliv () {
PPCV='/root/preferred_php_cli.version'
if [ $# -lt 1 ]
then
CAT='/usr/bin/cat'
PHPCLIVERSION="$($CAT $PPCV)"
echo "
phpcliv (aus bashfu)
Aktuelle PHP-CLI-Version (nicht die im Apache!) mit php -v:
"
php -v
echo "
Inhalt von ${PPCV}: $PHPCLIVERSION

phpcliv schaltet die PHP CLI Version um. PHP 7.4 (Kommando hier: phpcliv 74), PHP 8.0, PHP 8.1, PHP 8.2 stehen zur Verfügung.
Aufruf: phpcliv
= 74, 80, 81 oder 82
Beispiel: phpcliv 81
Die PHP CLI Version wird dann in /root/preferred_php_cli.version geschrieben.
Ohne Parameter wird nur diese Hilfe angezeigt und beendet.
"
elif [ "$1" == "74" ]
then
echo "
Schaltet auf PHP CLI 7.4 um.
"
update-alternatives --set php /usr/bin/php7.4
echo "7.4" > /root/preferred_php_cli.version
elif [ "$1" == "80" ]
then
echo "
Schaltet auf PHP CLI 8.0 um.
"
update-alternatives --set php /usr/bin/php8.0
echo "8.0" > /root/preferred_php_cli.version
elif [ "$1" == "81" ]
then
echo "
Schaltet auf PHP CLI 8.1 um.
"
update-alternatives --set php /usr/bin/php8.1
echo "8.1" > /root/preferred_php_cli.version
elif [ "$1" == "82" ]
then
echo "
Schaltet auf PHP CLI 8.2 um.
"
update-alternatives --set php /usr/bin/php8.2
echo "8.2" > /root/preferred_php_cli.version
fi
}
with that I easily switched from 8.2 to 8.0 which made cron work on my server (where cron did not run neither).
So now all is good. Thanks.
Average of ratings: Useful (1)