1748122 Members
3464 Online
108758 Solutions
New Discussion юеВ

Apache/PHP/Oracle...

 
Scott Nipp
Advisor

Apache/PHP/Oracle...

I have installed the latest verion of the hpuxwsApache package (A.2.0.55.00) on a new system. This is the first of a few systems that I will be upgrading to this version. Unfortunately I am unable to get Oracle database connectivity working thru PHP. So far, here is what I have done.

1. Editted the apachectl script to include the system specific Oracle parameters for the Oracle libraries etc.
2. Editted the php.ini file to uncomment the oci8.sl extension line.
3. Copied the Oracle client from a known working system.

The error I am receiving is:
Fatal error: Call to undefined function OCILogon()

Please help me figure this out. This is the first time I have run into difficulties trying to configure this. This is also the first time I have tried working with a package that is built with PHP5. My guess is that this is related. Thanks in advance.

Scott
7 REPLIES 7
Steven E. Protter
Exalted Contributor

Re: Apache/PHP/Oracle...

Shalom,

Oracle ships its own httpd server with the database and the application server that has this working already.

Questions/possible suggestions:
1) Did this work on prior versions of the HPWS suite? if so, steal the configuration from there.
2) Is there an oracle provided httpd server around? If so, another source to steal code and configuratoin.
3) Is PHP 5 certfied to work with oracle by oracle? If not, you may wish to redeploy a version of HPWS with PHP4 or use the oracle provide httpd server for this issue.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Scott Nipp
Advisor

Re: Apache/PHP/Oracle...

Just a little more information... I turned on PHP error logging and here is the output.

PHP Warning: PHP Startup: Unable to load dynamic library
'/opt/hpws/apache/php/lib/php/extensions/oci8.sl' - Can't find path for shared
library: libclntsh.sl.8.0 in Unknown on line 0


I have confirmed that this library is indeed located in /usr/local/oracle/8.0.6.3/lib, and this is in the PATH setup in the apachectl file. Once again, please help.

Scott
Yogeeraj_1
Honored Contributor

Re: Apache/PHP/Oracle...

hi scott,

also have a look at the documentations on how to install and configure these:

http://www.oracle.com/technology/tech/php/htdocs/inst_php_apache_linux.html

hope this helps!

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
TwoProc
Honored Contributor

Re: Apache/PHP/Oracle...

Your problem probably stems from the fact that you need to relink the binaries on the computer that you've put them on. Go to the ORACLE_HOME directory as the user that "owns" the ORACLE_HOME.
Make sure that ORACLE_HOME is defined in the environment.

Run:

find . -name "ins*.mk"

Then, for each of the above, cd to that directory and run
make -f ins_[whateverfilename].mk install

repeat for each of the files -

Or go to ORACLE_HOME/bin and run the "relink" command for each module in the ORACLE_HOME. For instance, you'll see that there is a "precomp" subdirectory, and a plsql directory.

So, you would run:
./relink precomp
and then
./relink plsql

Either of the two above methods should get you going.

We are the people our parents warned us about --Jimmy Buffett
Scott Nipp
Advisor

Re: Apache/PHP/Oracle...

OK. I have managed to get a little further, but now I am definitely stuck. Here is the output from the php_error.log when Apache starts up.

PHP Warning: PHP Startup: zM-jM-pM- zM-keM-2zM-jM-kxzM-j
M-pM-^PzM-keM-:zM-jM-kxzM-jM-pM-^@zM-kfB: Unable to initialize module
Module compiled with module API=20020429, debug=0, thread-safety=1
PHP compiled with module API=20041030, debug=0, thread-safety=1
These options need to match
in Unknown on line 0

I got to this by linking the libclntsh.sl library into a library path I founds from a strings output of the oci8.sl library in the Apache installation. Once again, help?!?!

Scott
Eberhard Maehr
Occasional Advisor

Re: Apache/PHP/Oracle...

Hi Scott,

probably your problem is the SHLIB_PATH variable. In the /opt/hpws/apache/bin/envvars file it should be set to
SHLIB_PATH="/opt/hpws/apache/lib:/home/oracle/product/816/lib64:/usr/local/pa20_64/lib:$SHLIB_PATH"
Make sure that the path is included here, where the libclntsh.sl library resides.

Hope this helps
Eberhard
Scott Nipp
Advisor

Re: Apache/PHP/Oracle...

I did a strings on the oci8.sl file in the /opt/hpws/apache/php/lib/php/extensions directory and discovered that it is looking for the libslntsh.sl library in /opt/oracle/lib. This simplest thing for me to do was to create this directory and put a link in there to the actual location of the library.

Thanks for the help. I know that this is not the best way to handle this, but it gets the job done. I have the SHLIB_PATH variable set to include the proper path in the apachectl file that starts Apache, but this did not resolve the issue. I fell back on this to correct this behavior.