Ubuntu 20.04 PHP Error: Unable to load dynamic library 'timezonedb.so'

root@cyberpanel:~# php -v
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
PHP 7.4.28 (cli) (built: Feb 17 2022 14:53:51) ( NTS )

How to fix above error? Using Ubuntu 20.04 with PHP 7.4

Try to install pecl successful then install timezonedb :


root@cyberpanel:~# /usr/local/lsws/lsphp74/bin/pecl install timezonedb
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
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading timezonedb-2021.5.tgz ...
Starting to download timezonedb-2021.5.tgz (631,371 bytes)
..............................................................................................................................done: 631,371 bytes
5 source files, building
running: phpize
/usr/local/lsws/lsphp74/bin/phpize: 1: /usr/bin/sed: not found
grep: write error: Broken pipe
/usr/local/lsws/lsphp74/bin/phpize: 1: /usr/bin/sed: not found
grep: write error: Broken pipe
/usr/local/lsws/lsphp74/bin/phpize: 1: /usr/bin/sed: not found
grep: write error: Broken pipe
Configuring for:
PHP Api Version:
Zend Module Api No:
Zend Extension Api No:
/usr/local/lsws/lsphp74/bin/phpize: 153: /usr/bin/sed: not found
autoheader: error: AC_CONFIG_HEADERS not found in configure.ac
ERROR: `phpize' failed
root@cyberpanel:~#

Omg! Just add sed then run again:

/usr/local/lsws/lsphp74/bin/pecl install timezonedb

Now everything is good:

root@cyberpanel:~# php -v
PHP 7.4.28 (cli) (built: Feb 17 2022 14:53:51) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.28, Copyright (c), by Zend Technologies
root@cyberpanel:~#

1 Like

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