Unable to load dynamic library 'timezonedb.so'

Can someone please help. Each time i use the command php -v I receive this error :

PHP Warning: PHP Startup: Unable to load dynamic library ‘timezonedb.so’ (tried: /usr/local/lsws/lsphp81/lib/php/20210902/timezonedb.so (/usr/local/lsws/lsphp81/lib/php/20210902/timezonedb.so: cannot open shared object file: No such file or directory), /usr/local/lsws/lsphp81/lib/php/20210902/timezonedb.so.so (/usr/local/lsws/lsphp81/lib/php/20210902/timezonedb.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘timezonedb.so’ (tried: /usr/local/lsws/lsphp81/lib/php/20210902/timezonedb.so (/usr/local/lsws/lsphp81/lib/php/20210902/timezonedb.so: cannot open shared object file: No such file or directory), /usr/local/lsws/lsphp81/lib/php/20210902/timezonedb.so.so (/usr/local/lsws/lsphp81/lib/php/20210902/timezonedb.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP 8.1.6 (cli) (built: May 15 2022 23:59:28) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.6, Copyright (c) Zend Technologies
with Zend OPcache v8.1.6, Copyright (c), by Zend Technologies

Hello @Zane Happy you are here

Look at this tutorial

https://pecl.php.net/package/timezonedb Release 2022.7

@josephgodwinke my friend. That was the first thing I’ve done. It didn’t work. I can re-do it again and post the results.
Something is wrong with my configuration but I don’t know where :frowning:

RUn this ls /usr/local/lsws/lsphp81/lib/php/ and post screenshot here

1 Like

Thank you. This is the screenshot:

command-1

Try run

$ /usr/local/lsws/lsphp81/bin/pecl install timezonedb-2022.7
$ sudo echo "extension=timezonedb.so" >> /usr/local/lsws/lsphp81/etc/php/8.1/mods-available/01-timezonedb.ini
$ systemctl restart lsws
$ ls /usr/local/lsws/lsphp81/lib/php/20210902/
# do you see timezonedb.so
1 Like

No :frowning:

The first command output is this:

root@panel:~# /usr/local/lsws/lsphp81/bin/pecl install timezonedb-2022.7
PHP Warning: PHP Startup: Unable to load dynamic library ‘timezonedb.so’ (tried: /usr/local/lsws/lsphp81/lib/php/20210902/timezonedb.so (/usr/local/lsws/lsphp81/lib/php/20210902/timezonedb.so: cannot open shared object file: No such file or directory), /usr/local/lsws/lsphp81/lib/php/20210902/timezonedb.so.so (/usr/local/lsws/lsphp81/lib/php/20210902/timezonedb.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘timezonedb.so’ (tried: /usr/local/lsws/lsphp81/lib/php/20210902/timezonedb.so (/usr/local/lsws/lsphp81/lib/php/20210902/timezonedb.so: cannot open shared object file: No such file or directory), /usr/local/lsws/lsphp81/lib/php/20210902/timezonedb.so.so (/usr/local/lsws/lsphp81/lib/php/20210902/timezonedb.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
WARNING: channel “pecl.php.net” has updated its protocols, use “pecl channel-update pecl.php.net” to update
downloading timezonedb-2022.7.tgz …
Starting to download timezonedb-2022.7.tgz (632,789 bytes)
…done: 632,789 bytes
5 source files, building
running: phpize
Configuring for:
PHP Api Version: 20210902
Zend Module Api No: 20210902
Zend Extension Api No: 420210902
shtool at ‘/tmp/pear/install/timezonedb/build/shtool’ does not exist or is not executable.
Make sure that the file exists and is executable and then rerun this script.

ERROR: `phpize’ failed

RUn this

$ 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
$ sh rebuild.sh # this runs phpize && ./configure && make clean && make
$ make install
$ echo "extension=timezonedb.so" >> /usr/local/lsws/lsphp81/etc/php/8.1/mods-available/01-timezonedb.ini
$ touch /usr/local/lsws/admin/tmp/.lsphp_restart.txt
$ systemctl restart lsws
$ ls /usr/local/lsws/lsphp81/lib/php/20210902/
# do you see timezonedb.so

I assume you are running ubuntu from the color of your terminal

1 Like

Dear Joseph, I really appreciate your help. While I can’t see timezonedb.so the message "Unable to load dynamic library ‘timezonedb.so’ " is gone.

command-3

The command apt-get install php8.1-dev was helpful as I was facing issues with phpize not found.
Is it safe now to install Composer and start doing my Laravel application?

Sure. But composer is installed by CyberP by default. Test to see if it is installed. Once you have your installation all setup and tested come back here to mark the solution to help the community. cheers!

1 Like

Sorry, but I’m having this issue now.

SImple issue time to edit php.ini and remove the line before the last line of extension=timezonedb

1 Like

Laravel works fully now and I can install any Codecanyon script Yeeeees! :grinning:

This topic was automatically closed 3 hours after the last reply. New replies are no longer allowed.