CyberPanel Community

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

OO
Oluwatobi Owolabi #1

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
14 replies
jo
josephgodwinke #2

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

OO
Oluwatobi Owolabi #3

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
OO
Oluwatobi Owolabi #5

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

jo
josephgodwinke #6

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

It will install for the default php

OO
Oluwatobi Owolabi #7

Did not solve the issue after installing and restarting lightspeed

jo
josephgodwinke #10
$ 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 ?

OO
Oluwatobi Owolabi #11

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

Apologies for my late reply

jo
josephgodwinke #14

Have you confirmed this ?

Sign in to reply