torayeff
torayeff

Reputation: 9702

oci8 installation with xampp

I have installed xampp on my linux machine. I want to add oci8 oracle 11g extension for php. What I do:

[root@cpcolvir bin]# /opt/lampp/lampp oci8
Please enter the path to your Oracle or Instant Client installation:
[/opt/oracle] /usr/lib/oracle/11.2/client64/lib/

But it gives me error:

Can't find libclntsh.so. Sorry.

But I am sure that libclntsh.so is in /usr/lib/oracle/11.2/client64/lib/. What I am doing wrong?

Upvotes: 1

Views: 8563

Answers (3)

Kevin Chui
Kevin Chui

Reputation: 177

I have just installed an Oracle Instant Client 11.2, Ubuntu 12.04 and xampp 1.7.x. Try the following steps

  1. Download instantclient-basic-linux-11.2.0.4.0.zip and instantclient-sdk-linux-11.2.0.4.0.zip from Oracle

  2. Extract it to same folder and move it to /opt/oracle_instantclient

  3. Append the following setting to end of /etc/environment

    $sudo vi /etc/environment

    ...

    LD_LIBRARY_PATH="/opt/oracle_instantclient"

    TNS_ADMIN="/opt/oracle_instantclient"

    ORACLE_BASE="/opt/oracle_instantclient"

    ORACLE_HOME=$ORACLE_BASE

  4. building the oci8.so (this should be completed without error)

    $sudo pecl install oci8

    You will be prompted for input during the configurations, input the following

    instantclient,/opt/oracle_instantclient

  5. add the following line to the /opt/lampp/etc/php.ini

    extension=oci8.so

  6. create the following links to avoid startup apache error

    $sudo ln -s /opt/oracle_instantclient/libclntsh.so.11.1 /opt/oracle_instantclient/libclntsh.so

    $sudo ln -s /opt/oracle_instantclient/libclntsh.so.11.1 /opt/oracle_instantclient/libclntsh.so.10.1

  7. restart your lampp server

    $sudo /opt/lampp/lampp restart

Upvotes: 2

Leorick.Simon
Leorick.Simon

Reputation: 21

I'm facing the same issue and did some tracing. When I take a look into this file, script file when we perform "./lampp oci8";

/opt/lampp_181/share/lampp/oci8install

I found out that it wasn't looking for "libclntsh.so" actually but "libclntsh.so.10*"

libclntsh=`find $ora_home -name "libclntsh.so.10*" | head -1`

Try to create a softlink "libclntsh.so.10.1 -> libclntsh.so" and "libclntsh.so -> libclntsh.so.11.1" as below;

lrwxrwxrwx 1 oracle dba       69 2013-12-24 10:46 libclntsh.so -> /home/oracle/app/oracle/product/11.2.0/client_2/lib/libclntsh.so.11.1*
lrwxrwxrwx 1 oracle dba       64 2013-12-24 10:46 libclntsh.so.10.1 -> /home/oracle/app/oracle/product/11.2.0/client_2/lib/libclntsh.so*
-rwxr-xr-x 1 oracle dba 39997991 2013-12-24 10:46 libclntsh.so.11.1*

Never try that before but I saw this in the full Oracle Client lib dir. One thing for sure, my XAMPP is running fine when I point oci8 to this location.

Oracle Run-time Client Library Version 11.2.0.1.0

my phpinfo() output

Upvotes: 2

JaMaBing
JaMaBing

Reputation: 1041

after installation oracle instantclient, you should set the library path and let the last backslash away

export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib:$LD_LIBRARY_PATH

and reinstall oci8 by

pecl install oci8

further more edit your php.ini (my is at /etc/php5/apache2/php.ini) by adding

extension=oci8.so

and restart apache

Upvotes: 2

Related Questions