Search My Techie Guy

Tuesday, September 26, 2017

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/yy.so'

Summary: 
PHP Warning while trying to test PHP installation with a simple command "php -v"

NAME="Oracle Linux Server" 
VERSION="6.9"

Problem or Goal: 

 # php -v
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/curl.so' - /usr/lib/php/modules/curl.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 '/usr/lib/php/modules/dom.so' - /usr/lib/php/modules/dom.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 '/usr/lib/php/modules/fileinfo.so' - /usr/lib/php/modules/fileinfo.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 '/usr/lib/php/modules/gd.so' - /usr/lib/php/modules/gd.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 '/usr/lib/php/modules/imap.so' - /usr/lib/php/modules/imap.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 '/usr/lib/php/modules/intl.so' - /usr/lib/php/modules/intl.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 '/usr/lib/php/modules/json.so' - /usr/lib/php/modules/json.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 '/usr/lib/php/modules/ldap.so' - /usr/lib/php/modules/ldap.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 '/usr/lib/php/modules/mbstring.so' - /usr/lib/php/modules/mbstring.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 '/usr/lib/php/modules/mysql.so' - /usr/lib/php/modules/mysql.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 '/usr/lib/php/modules/mysqli.so' - /usr/lib/php/modules/mysqli.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 '/usr/lib/php/modules/pdo.so' - /usr/lib/php/modules/pdo.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 '/usr/lib/php/modules/pdo_mysql.so' - /usr/lib/php/modules/pdo_mysql.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 '/usr/lib/php/modules/pdo_sqlite.so' - /usr/lib/php/modules/pdo_sqlite.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 '/usr/lib/php/modules/phar.so' - /usr/lib/php/modules/phar.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 '/usr/lib/php/modules/posix.so' - /usr/lib/php/modules/posix.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 '/usr/lib/php/modules/snmp.so' - /usr/lib/php/modules/snmp.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 '/usr/lib/php/modules/sqlite3.so' - /usr/lib/php/modules/sqlite3.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 '/usr/lib/php/modules/sysvmsg.so' - /usr/lib/php/modules/sysvmsg.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 '/usr/lib/php/modules/sysvsem.so' - /usr/lib/php/modules/sysvsem.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 '/usr/lib/php/modules/sysvshm.so' - /usr/lib/php/modules/sysvshm.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 '/usr/lib/php/modules/wddx.so' - /usr/lib/php/modules/wddx.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 '/usr/lib/php/modules/xmlreader.so' - /usr/lib/php/modules/xmlreader.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 '/usr/lib/php/modules/xmlwriter.so' - /usr/lib/php/modules/xmlwriter.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 '/usr/lib/php/modules/xsl.so' - /usr/lib/php/modules/xsl.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 '/usr/lib/php/modules/zip.so' - /usr/lib/php/modules/zip.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP 5.3.3 (cli) (built: Jan 10 2017 22:26:04) 
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies


Cause:
If you check the PHP's initialization file (php.ini), the problem here was the directory in which the loadable extensions (modules) reside. Usually the default directory in the php.ini is set to "/usr/lib/php/modules" but in my installation, i have "lib64" NOT "lib" and should therefore change to "/usr/lib64/php/modules"

Solution: 
You can run the command below to find location of the php modules on your installation. for example if you are looking for "json.so"
 [root@localhost]# find / -name json.so
/usr/lib64/php/modules/json.so

Before:


After:


Problem Solved?
# php -v
PHP 5.3.3 (cli) (built: Jan 10 2017 22:26:04) 
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

No comments: