sudo apt-get install php5-mcrypt sudo apt-get install php5-mysql
Источник
php-oci8 - libclntsh.so.18.1: cannot open shared object file
Check modules again and oci8 not yet loaded. In order to test if it fails with all modules I tried with mbstring (not installed by default):
# yum --enablerepo=remi-php72 install php-mbstring Installed: php-mbstring.x86_64 0:7.2.17-1.el6.remi Complete!
If I do php -m mbstring successfully listed there. Am I missing something with oci8 ? Thank you in advance.
Update
PHP Warning: PHP Startup: Unable to load dynamic library 'oci8' (tried: /usr/lib64/php/modules/oci8 (/usr/lib64/php/modules/oci8: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/oci8.so (libclntsh.so.18.1: cannot open shared object file: No such file or directory)) in Unknown on line 0
Looks like php can not find libclntsh.so.18.1 library from Oracle client. So I decided to check the oracle's home lib to take look:
# ls -l libclntsh* lrwxrwxrwx. 1 oracle oinstall 61 Mar 26 16:20 libclntsh.so -> /u01/app/oracle/product/11.2.0/dbhome_1/lib/libclntsh.so.11.1 lrwxrwxrwx. 1 oracle oinstall 56 Mar 26 16:19 libclntsh.so.10.1 -> /u01/app/oracle/product/11.2.0/dbhome_1/lib/libclntsh.so -rwxr-xr-x. 1 oracle oinstall 47251283 Mar 26 16:20 libclntsh.so.11.1
What I am thinking is that the oci8 extension is trying to load this library for 18c oracle version while my current client is 11g. No idea on how to solve it.
1 Answer 1
To solve this problem, it is necessary to download Oracle Client 18.5.0 Base - Linux x86-64 here:
Unzip sources as oracle user:
$ cd /u01/app/oracle/product/ $ mkdir 18.5.0 $ cd 18.5.0 $ wget -c https://download.oracle.com/otn/linux/instantclient/185000/instantclient-basic-linux.x64-18.5.0.0.0dbru.zip?AuthParam=1555443721_28dfadc632483f950d87ee5f54810e06 -O instantclient-basic-linux.x64-18.5.0.0.0dbru.zip $ unzip instantclient-basic-linux.x64-18.5.0.0.0dbru.zip
Doing ls you can confirm that the library is right there:
$ ls -l instantclient_18_5/ total 227712 -rwxr-xr-x. 1 oracle oinstall 42360 Feb 26 20:04 adrci -r-xr-xr-x. 1 oracle oinstall 5780 Feb 26 20:04 BASIC_LICENSE -rw-r--r--. 1 oracle oinstall 1632 Feb 26 20:04 BASIC_README -rwxr-xr-x. 1 oracle oinstall 66672 Feb 26 20:04 genezi -rwxrwxr-x. 1 oracle oinstall 8357160 Feb 26 20:04 libclntshcore.so.18.1 lrwxrwxrwx. 1 oracle oinstall 17 Apr 16 20:42 libclntsh.so -> libclntsh.so.18.1 -rwxrwxr-x. 1 oracle oinstall 78200832 Feb 26 20:04 libclntsh.so.18.1 -r-xr-xr-x. 1 oracle oinstall 3551217 Feb 26 20:04 libipc1.so -r-xr-xr-x. 1 oracle oinstall 467932 Feb 26 20:04 libmql1.so -r-xr-xr-x. 1 oracle oinstall 6636088 Feb 26 20:04 libnnz18.so lrwxrwxrwx. 1 oracle oinstall 15 Apr 16 20:42 libocci.so -> libocci.so.18.1 -r-xr-xr-x. 1 oracle oinstall 2282891 Feb 26 20:04 libocci.so.18.1 -rwxr-xr-x. 1 oracle oinstall 126959616 Feb 26 20:04 libociei.so -r-xr-xr-x. 1 oracle oinstall 160875 Feb 26 20:04 libocijdbc18.so -r-xr-xr-x. 1 oracle oinstall 394835 Feb 26 20:04 libons.so -r-xr-xr-x. 1 oracle oinstall 117635 Feb 26 20:04 liboramysql18.so drwxr-xr-x. 3 oracle oinstall 4096 Feb 26 20:04 network -r--r--r--. 1 oracle oinstall 4161744 Feb 26 20:04 ojdbc8.jar -r--r--r--. 1 oracle oinstall 1398331 Feb 26 20:04 ucp.jar -rwxr-xr-x. 1 oracle oinstall 242008 Feb 26 20:04 uidrvci -rw-r--r--. 1 oracle oinstall 74263 Feb 26 20:04 xstreams.jar
Finnaly, it is mandatory to set LD_LIBRARY_PATH env variable in order to let PHP where to find the library:
$ export LD_LIBRARY_PATH=/u01/app/oracle/product/18.5.0/instantclient_18_5
Now, you can check that oci8 is correctly listed there:
$ php -m [PHP Modules] bz2 calendar Core ctype curl date exif fileinfo filter ftp gettext hash iconv json libxml mbstring oci8
Источник
Unable to load dynamic php_mbstring.dll library
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_mbstring.dll' - /usr/lib/php/20151012/php_mbstring.dll: cannot open shared object file: No such file or directory in Unknown on line 0 PHP 7.0.4-7ubuntu2 (cli) ( NTS ) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
I have uncommented this line extension=php_mbstring.dll in my /etc/php/7.0/fpm/php.ini file and this doesn't seem to solve my problem. How would i get rid of this warning?
I agree with what you are saying. Question is why would a windows error show in ubuntu and how can I install the mbstring.so library?
4 Answers 4
In php.ini search "extension_dir" : uncomment for the platform (in my case it is on Windows:)
; Directory in which the loadable extensions (modules) reside. ; http://php.net/extension-dir ; extension_dir = "./" ; On windows: extension_dir = "ext"
I was running into the same PHP warnings when trying to run it from the command line. This was on a Homestead Vagrant Ubuntu box, where i was getting:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20160303/php_mbstring.dll' - /usr/lib/php/20160303/php_mbstring.dll: 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/20160303/php_exif.dll' - /usr/lib/php/20160303/php_exif.dll: cannot open shared object file: No such file or directory in Unknown on line 0
What I didn't realize is that it uses a php.ini in a separate /cli/ directory (E.g. /etc/php/7.X/cli/php.ini) when you're running php on the command line or using a CLI that uses PHP
Based on the paths in your question, look for /etc/php/7.0/cli/php.ini and you should comment out the mbstring module (assuming Linux):
extension=php_mbstring.dll ;extension=php_mbstring.dll ; commented out
If this doesn't solve the issue for you, try running:
php -i | grep -i "Loaded Configuration File"
This pointed me at the correct php.ini file:
Loaded Configuration File => /etc/php/7.1/cli/php.ini
Источник
how to solve myqli.so ,cannot open shared object file
Message: PHP Startup: Unable to load dynamic library '/path/to/extension/mysqli.so' (tried: /path/to/extension/mysqli.so (/path/to/extension/mysqli.so: cannot open shared object file: No such file or directory), /usr/lib/php/20170718//path/to/extension/mysqli.so.so (/usr/lib/php/20170718//path/to/extension/mysqli.so.so: cannot open shared object file: No such file or directory)) A PHP Error was encountered Severity: Core Warning Message: PHP Startup: Unable to load dynamic library '/path/to/extension/mysqli.so' (tried: /path/to/extension/mysqli.so (/path/to/extension/mysqli.so: cannot open shared object file: No such file or directory), /usr/lib/php/20170718//path/to/extension/mysqli.so.so (/usr/lib/php/20170718//path/to/extension/mysqli.so.so: cannot open shared object file: No such file or directory)) Filename: Unknown Line Number: 0 command :find / -name 'mysqli.so' /usr/lib/php/20190902/mysqli.so /usr/lib/php/20170718/mysqli.so /usr/lib/php/20151012/mysqli.so command: find / -name 'php.ini' /etc/php/7.0/cli/php.ini /etc/php/7.0/apache2/php.ini /etc/php/7.2/cli/php.ini /etc/php/7.2/apache2/php.ini /etc/php/7.4/cli/php.ini /etc/php/7.4/apache2/php.ini i would like to solve this severity warning.
1 Answer 1
You have to reinstall the package for this library depending on your Ubuntu version:
sudo apt-get install --reinstall php7.0-mysql # for 16.04 LTS sudo apt-get install --reinstall php7.2-mysql # for 18.04 LTS sudo apt-get install --reinstall php7.4-mysql # for 20.04 LTS and 20.10
Источник