PHP7.0 - unable to load dynamic library oci8.so (Ubuntu)

半城伤御伤魂 提交于 2019-12-02 08:25:11

I'm using Ubuntu 16.04 and php version 7.1

There are few directories in /usr/lib/php/ for example

20131226 for php5.6

20160303 for php7.1

so problem with me that, the oci8 extension got installed on the wrong ( a user lib folder for php7.2) so I had to remove the php 7.2 completly

sudo apt-get purge php7.2-common

then I had uninstall the oci8 by running following command

sudo pecl uninstall oci8

and install again by running the following command

sudo pecl install oci8

To check the configuration loaded you do

php-config --extension-dir

And make sure that all extension are installed in the correct extension directory.

Make changes in the /etc/php/7.1/apache2/php.ini and /etc/php/7.1/cli/php.ini

Check by running phpinfo(); You must see this, ignore the cli if that stills gives you same error as your web shows the extension is getting loaded.

grondon

I solved adding the following to /etc/environment:

LD_LIBRARY_PATH=/opt/oracle/instantclient_12_2:$LD_LIBRARY_PATH

I followed this tutorial: https://gist.github.com/hewerthomn/81eea2935051eb2500941a9309bca703

What I did was completely remove any installations of PHP and reinstall the version that I need.

sudo apt-get purge 'php*'

Source: https://askubuntu.com/a/59889/226518

Or:

export LD_LIBRARY_PATH=/usr/local/instantclient_12_1/

I had the same problem, it works for me.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!