Friends,
I have two different Hestia Servers both using Debian 11. On each I created a Hestia user with PHP 8.1 CLI. On each, about one year ago, I installed a domain with SSL for each user in which I installed a Moodle educational website using PHP 8.1. The final step of installing Moodle is creating a cron job to keep everything up to date.
In each user account, I clicked on CRON, Add Cron Job. The cron jobs worked perfectly until November 27, 2023. At almost exactly the same time, both cron jobs stopped working and have not worked ever since. I did not notice this problem until two weeks ago when I was updating the Moodle version on each site. I have spent the past two weeks trying to resolve this problem.
I read in the Hestia forum a post on Nov 23 2023 that described the exact Moodle cron problem I have. Here is the link:
Here was the error:
If I try to run cron.php script manually I get:
!!! ExcepciĂłn - Call to undefined function pcntl_signal() !!!
Here was the solution:
I managed to solve it. I just had to remove pcntl_signal from the php.ini
(Unfortunately, the poster did not explain how to remove pcntl_signal from the php.ini )
Then on Dec 23, 2023, a person asked how to install php pcntl. Here is the link:
A person gave the following advice. (which explained how to remove pcntl_signal from the php.ini )
You should edit the php.ini for the PHP version you are using:
Example using php 8.1:
Edit files:
/etc/php/8.1/cli/php.ini
/etc/php/8.1/fpm/php.ini
And remove pcntl_signal from disable_functions directive
Before:
disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority
After:
disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority
Once done, restart php 8.1:
systemctl restart php8.1-fpm
I am hoping I can solve my Moodle Cron problem by removing pcntl_signal from disable_functions directive.
However, I went to edit files:
/etc/php/8.1/cli/php.ini
/etc/php/8.1/fpm/php.ini
and neither of these files has a section called disable_functions!
Both files are 2000 lines long. I looked carefully at both three times with no luck.
I am hoping someone can help me solve this problem and also let me know if there is any drawbacks to removing pcntl_signal from disable_functions directive.