Mautic cron Job error: Unable to load dynamic library 'timezonedb.so'

When I tried to run cron job for Mautic it is not working and checking it from the cli, it throws the error below and I also noticed that while the Mautic PHP is 8.0 the one on cli is 7.4

user@cyberpanel:~$ /usr/bin/php /home/m.bluespace.ng/public_html/bin/console mautic:campaigns:update
PHP Warning:  PHP Startup: Unable to load dynamic library 'timezonedb.so' (tried: /usr/local/lsws/lsphp74/lib/php/20190902/timezonedb.so (/usr/local/lsws/lsphp74/lib/php/20190902/timezonedb.so: cannot open shared object file: No such file or directory), /usr/local/lsws/lsphp74/lib/php/20190902/timezonedb.so.so (/usr/local/lsws/lsphp74/lib/php/20190902/timezonedb.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

Hello @tobsowo

Error is very clear you are missing timezonedb module.

Switch to php 8.0 as default php

You can change default PHP version in SSH terminal:

$ cp -f /usr/local/lsws/lsphp80/bin/php /usr/bin/

OR use php74 across both cyberpanel and mautic

Thank you.
I was able to change the default php version to 8.0 but the error still persist.

user@pyberpanel:~$ php -v
PHP Warning:  PHP Startup: Unable to load dynamic library 'timezonedb.so' (tried: /usr/local/lsws/lsphp80/lib/php/20200930/timezonedb.so (/usr/local/lsws/lsphp80/lib/php/20200930/timezonedb.so: cannot open shared object file: No such file or directory), /usr/local/lsws/lsphp80/lib/php/20200930/timezonedb.so.so (/usr/local/lsws/lsphp80/lib/php/20200930/timezonedb.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP 8.0.28 (cli) (built: Feb 14 2023 14:47:46) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.28, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.28, Copyright (c), by Zend Technologies

Seems you didnt click this link - Unable to load dynamic library 'timezonedb.so' - #8 by josephgodwinke

Next cause of action is install

I encountered error

$ cd ~
$ apt-get install libmagickwand-dev pkg-config build-essential lsphp81-dev
$ wget -O timezonedb.tar.gz https://github.com/php/pecl-datetime-timezonedb/archive/refs/tags/RELEASE_2022_7.tar.gz
$ tar vxzf timezonedb.tar.gz
$ cd pecl-datetime-timezonedb-RELEASE_2022_7

When I run
$ sh rebuild.sh # this runs phpize && ./configure && make clean && make

I get error rebuild.sh: 3: phpize: not found

Try sudo apt-get install php-dev || yum install php-devel

It will install for the default php

Did not solve the issue after installing and restarting lightspeed

Which server os is this ?

Ubuntu 22.04

$ cp -f /usr/local/lsws/lsphp80/bin/php /usr/bin/
$ cd ~
$ apt-get install libmagickwand-dev pkg-config build-essential lsphp80-dev
$ wget -O timezonedb.tar.gz https://github.com/php/pecl-datetime-timezonedb/archive/refs/tags/RELEASE_2023_1.tar.gz
$ tar vxzf timezonedb.tar.gz
$ cd pecl-datetime-timezonedb-RELEASE_2023_1
$ sh rebuild.sh && ./configure && make clean && make
$ make install
$ echo "extension=timezonedb.so" >> /usr/local/lsws/lsphp80/etc/php/8.0/mods-available/01-timezonedb.ini
$ touch /usr/local/lsws/admin/tmp/.lsphp_restart.txt
$ systemctl restart lsws
$ ls /usr/local/lsws/lsphp80/lib/php/20200930/

do you see timezonedb.so ?

The command works without install but still did not install timezonedb.so as it is not on the list.

Apologies for my late reply

Did you run these steps Mautic cron Job error: Unable to load dynamic library 'timezonedb.so' - #10 by josephgodwinke ?

Yes, the whole steps without any issues.

Have you confirmed this ?

Yes, it’s 8.0