Hi
I know this is a bit old, but posting anyway. I may help the next person coming to this thread.
I had the same issue with Moodle 4.3.3
Error:
Execute scheduled task: Cleanup old sessions (core\task\session_cleanup_task)
!!! Exception - Class "IntlTimeZone" not found !!!
I first checked the below:
All extensions were present in the server/environment tab
I made sure extension=intl was enabled in php.ini
I added the timezone value in config.php
None of the above worked. I then ran the following command and it fixed the issue for me.
sudo apt-get install -y php-intl
Full trace from install of php-intl:
# sudo apt-get install -y php-intl
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
php8.1-intl
The following NEW packages will be installed:
php-intl php8.1-intl
0 upgraded, 2 newly installed, 0 to remove and 24 not upgraded.
1 not fully installed or removed.
Need to get 144 kB of archives.
After this operation, 522 kB of additional disk space will be used.
Get:1
http://mirror.hetzner.com/ubuntu/packages jammy-updates/universe amd64 php8.1-intl amd64 8.1.2-1ubuntu2.15 [142 kB]
Get:2
http://mirror.hetzner.com/ubuntu/packages jammy/universe amd64 php-intl all 2:8.1+92ubuntu1 [1,840 B]
Fetched 144 kB in 0s (9,815 kB/s)
Selecting previously unselected package php8.1-intl.
(Reading
database ... 220154 files and directories currently installed.)
Preparing to unpack .../php8.1-intl_8.1.2-1ubuntu2.15_amd64.deb ...
Unpacking php8.1-intl (8.1.2-1ubuntu2.15) ...
Selecting previously unselected package php-intl.
Preparing to unpack .../php-intl_2%3a8.1+92ubuntu1_all.deb ...
Unpacking php-intl (2:8.1+92ubuntu1) ...
Setting up update-notifier-common (3.192.54.8) ...
Traceback (most recent call last):
File "/usr/lib/update-notifier/package-data-downloader", line 24, in import debian.deb822
ModuleNotFoundError: No module named 'debian'
dpkg: error processing package update-notifier-common (--configure):
installed update-notifier-common package post-installation script subprocess returned error exit status 1
Setting up php8.1-intl (8.1.2-1ubuntu2.15) ...
Creating config file /etc/php/8.1/mods-available/intl.ini with new version
Setting up php-intl (2:8.1+92ubuntu1) ...
Processing triggers for libapache2-mod-php8.1 (8.1.2-1ubuntu2.15) ...
Processing triggers for php8.1-fpm (8.1.2-1ubuntu2.15) ...
NOTICE: Not enabling PHP 8.1 FPM by default.
NOTICE: To enable PHP 8.1 FPM in Apache2 do:
NOTICE: a2enmod proxy_fcgi setenvif
NOTICE: a2enconf php8.1-fpm
NOTICE: You are seeing this message because you have apache2 package installed.
Processing triggers for php8.1-cli (8.1.2-1ubuntu2.15) ...
Processing triggers for php8.1-cgi (8.1.2-1ubuntu2.15) ...
Errors were encountered while processing:
update-notifier-common
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)