0

I am running php v5 on RHEL using oracle client 19 (tnsnames.ora) I have odbcinst.ini and odbc.ini setup and is working from command prompt via:

isql -v myOdbc username pw

I had to specify LD_LIBRARY_PATH in order to get that to work. But now when I run test page in php and I try the odbc_connect command, it is giving me the following error: "Can't open lib '/var/opt/oracle/client2/lib/libsqora.so.19.1'" - which is the value that is in LD_LIBRARY_PATH

So it seems LD_LIBRARY_PATH isn't set correctly for Apache or PHP? If I do

php --info 

That returns: _SERVER["LD_LIBRARY_PATH"] => /var/opt/oracle/client2/lib so PHP "seems" to know the LD_LIBRARY_PATH but somehow Apache or something else doesn't?

Here is odbcinst.ini

[ODBC]
Trace=Yes
TraceFile=/tmp/sql.log
ForceTrace=No
Pooling=No
UsageCount=2

[Oracle_ODBC_Driver_in_ora19c]
Description=Oracle 19c ODBC driver.
Driver=/var/opt/oracle/client2/lib/libsqora.so.19.1
Setup=
FileUsage=
CPTimeout=
CPReuse=
UsageCount=2

Here is odbc.ini

[myOdbc]
Description     = wilson
Driver          = Oracle_ODBC_Driver_in_ora19c
DSN             = myDbCon.com
ServerName      = myDbCon.com

Obviously /var/opt/oracle/client2/lib/libsqora.so.19.1 exists and is executable or isql wouldn't work, correct?

I have verified all are 64 bit architecture so I "think" I just need to know where/how to set LD_LIBRARY_PATH so when called from php it knows where the driver is?

0

1 Answer 1

1

Found the problem, if we added LD_LIBRARY_PATH and ORACLE_HOME to /etc/sysconfig/httpd then it worked!!! Hope this helps someone else!

Sign up to request clarification or add additional context in comments.

1 Comment

If you are using Instant Client, then don't set ORACLE_HOME.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.