Topic: after upgrading PHP 5.3 to 5.6 from remi repository OCI8 giving error

Dear Friends,

I have upgraded my php on centos 6.6 from 5.3 to 5.6 using the following repository

(wget dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm)
(wget rpms.famillecollet.com/enterprise/remi-release-6.rpm)

after upgradtion I was getting the following error

Starting php-fpm: [03-May-2017 14:43:19] NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/oci8.so' - libclntsh.so.12.1: cannot open shared object file: No such file or directory in Unknown on line 0
r when starting PHP

after going through the forums I found I have to install OCI8 from the remi repository which I did
now I am getting the following error when starting PHP

Starting php-fpm: [03-May-2017 14:43:19] NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/oci8.so' - libclntsh.so.12.1: cannot open shared object file: No such file or directory in Unknown on line 0
[03-May-2017 14:43:19] NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/oci8.so' - libclntsh.so.12.1: cannot open shared object file: No such file or directory in Unknown on line 0
[03-May-2017 14:43:19] NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/pdo_oci.so' - libclntsh.so.12.1: cannot open shared object file: No such file or directory in Unknown on line 0

I have added LD_LIBRARY_PATH env var but the result is same.

Any help is appreciated!!!!!

Thanks,
Basid.

Re: after upgrading PHP 5.3 to 5.6 from remi repository OCI8 giving error

Do you need oci8 extension ?
Do you have Oracle 12.1 client installed ?

Desktop: Fedora 25 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 26 x86_64 + remi (SCL only)
Hosting Server: CentOS 6.9 x86_64 + EPEL + remi + remi-php70

Re: after upgrading PHP 5.3 to 5.6 from remi repository OCI8 giving error

Yes I need OCI8 extension.
Before upgrading to PHP 5.6 OCI8 was installed and working with PHP 5.3, this problem only coming after upgrading the PHP to 5.6 from remi.
Yes I have the following oracle rpm installed on the system.

oracle-instantclient12.1-basic-12.1.0.1.0-1.x86_64.rpm and
oracle-instantclient12.1-devel-12.1.0.1.0-1.x86_64.rpm

Re: after upgrading PHP 5.3 to 5.6 from remi repository OCI8 giving error

Before upgrading to PHP 5.6 OCI8 was installed and working with PHP 5.3, this problem only coming after upgrading the PHP to 5.6 from remi.

5.3 was probably using an older version (10.x or 11.x)
Your configuration need to be fixed.

So, you need to define LD_LIBRARY_PATH to location of libclntsh.so.12.1

As you are using fpm, need to be in /etc/sysconfig/php-fpm

export LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib

Or more widely using /etc/ld.so.conf.d/oracle-instantclient-x86_64.conf

Desktop: Fedora 25 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 26 x86_64 + remi (SCL only)
Hosting Server: CentOS 6.9 x86_64 + EPEL + remi + remi-php70

Re: after upgrading PHP 5.3 to 5.6 from remi repository OCI8 giving error

I have added LD_LIBRARY_PATH env var but the result is same.

If you mean, you use the "env" directive in FPM pool configuration, this cannot work (need to be defined before loading FPM, can't be load by FPM)

Desktop: Fedora 25 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 26 x86_64 + remi (SCL only)
Hosting Server: CentOS 6.9 x86_64 + EPEL + remi + remi-php70

Re: after upgrading PHP 5.3 to 5.6 from remi repository OCI8 giving error

After adding

export LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib

in /etc/sysconfig/php-fpm file OCI8 is working, it is showing in the phpinfo() page.

Thanks a lot you saved my day!

Re: after upgrading PHP 5.3 to 5.6 from remi repository OCI8 giving error

smile

Desktop: Fedora 25 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 26 x86_64 + remi (SCL only)
Hosting Server: CentOS 6.9 x86_64 + EPEL + remi + remi-php70