Operating System - HP-UX
1824933 Members
3796 Online
109678 Solutions
New Discussion юеВ

HPWS Apache with PHP and Oracle

 
Griffel
Advisor

HPWS Apache with PHP and Oracle

Hello, who can help?

The designers of the hpws distribution can particularly help me.

I have 2 problems with the HP Webserver distribution HPUXWSATW-A212 and
the modul php and the oracle library oci8.sl.

#1
The webserver software hpws was installed without bugs with swinstall.
A problem was start this from the comand linie version of php und pear.

Error message : "/usr/lib/dld.sl: Can┬┤t open shared library: /CLO/BUILD_ENV/lib/libdld.2"
"/usr/lib/dld.sl: No such file or directory"

I have made a directory /CLO/build and made a connection to /usr in this directory.
This is a bad away but php and pear works.
However, cause is the faulty distribution of the software of HP.


#2
The Error message ist "Unable to load dynamic library /opt/hpws/apache/php/lib/php/extensions/oci8.sl' -
Invalid flags for dlopen: /opt/hpws/apache/php/lib/php/extensions/oci8.sl in Unknown on linie 0

The client is installed by Oracle 9.2 on the HPUX 11.11 server.
I have put all Enviroment variables ORACLE_HOME,SH_LIBPATH,SD_LIBRAY_PATH and LD_PRELOAD in apachectl for oracle.
The problem is probably hidden here, too.
The output by ld -t oci8.sl is : Can`t open /opt/oracle/lib/libclntsh.sl.8.0.
The same result at chatr oci8.sl.
When I make a soft link from libclntsh.sl.9.0 on libclntsh.sl.8.0, the Error message is : "bad magic nummber e.g.".

However, I don't have any client for Oracle 8 and he doesn't have to be got any more, too.

Many thanks!
15 REPLIES 15
Steven E. Protter
Exalted Contributor

Re: HPWS Apache with PHP and Oracle

Couple of things.

The error message in section 1 is usually caused by the wrong value or missing directory in the SHLIB_PATH variable.

That being said, Oralcle ships with its own httpd server which is based on apache.

There are pieces of Oracle that are built on Oracle 8 components. The error message is misleading to a great degree.

This problem is also most likely to be an environment variable. Oracle's manual for the 9.2 database is very specfic and needs to be followed concerning patching and required environment varibables and patching and optional products.

The soft link solution you tried is innnovative, but not the answer.

If you are running a mixed Oracle 8/9 environment, I have a few tools developed that might help you handle envrionment switching issues.

If you have some reason to use the HP version of apache and php et al, then make sure the SHLIB_PATH variable at install time includes those tools you have already installed, which are in the /opt/hpws directory.

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
Ermin Borovac
Honored Contributor

Re: HPWS Apache with PHP and Oracle

You may have better luck if you link /opt/oracle/lib/libclntsh.sl.8.0 to $ORACLE_HOME/lib32/libclntsh.sl.9.0.

$ORACLE_HOME/lib/libclntsh.sl.9.0 is 64-bit library and it won't load in HP's apache, which is 32-bit.

$ORACLE_HOME/lib32/libclntsh.sl.9.0 is 32-bit library, so linking to it may work.
Griffel
Advisor

Re: HPWS Apache with PHP and Oracle

Many Thanks Steven and Ermin,

but it don`t help me.

#1 -I have reinstall hpws
export /ORACLE/HOME="/opt/oracle/products/9ir2
export SHLIB_PATH=/usr/lib:/usr/local/lib:/opt/hpws/apache/lib:/$ORACLE_HOME/lib:/$ORACLE/HOME/lib32:/opt/hpws/apache/php/lib/php/extensions
export LD_PRELOAD=$ORACLE_HOME/JRE/lib/PA_RISC/native_threads/libjava.sl

- swinstall -s /daten/HPUXWSATW-A212-1100.depot

The same error as under exactly 1.
The /CLO/BUILD_ENV is in the file php-config written.
The variable extension_dir is also put wrongly.Swinstall set the oci8.sl under
/opt/hpws/apache/php/lib/php/extensions.

See appendix file php-config.

#2 I have made a softlink of libclntsh.9.0 (lib32)to libclntsh.8.0 . Without success.
However, another path is registered in the library oci8.sl. With this command chatr to see.
The location for the client oracle client library is /$ORACLE_HOME/lib/libclntsh.sl.9.0 or. .../lib32/lib...
The oci8 path for the client library is /opt/oracle/lib/libclntsh.sl.8.0

I wish a beautiful weekend!

Ermin Borovac
Honored Contributor

Re: HPWS Apache with PHP and Oracle

Please try the following

$ cd $ORACLE_HOME/lib32
$ ln -s libclntsh.sl.9.0 libclnsth.sl.8.0
$ export SHLIB_PATH=$ORACLE_HOME/lib32
$ ldd /opt/hpws/apache/php/lib/php/extensions/oci8.sl

ldd shouldn't return any errors and it should show you that oci8.sl picked up oracle library from $ORACLE_HOME/lib32.

If all is ok, make sure you export SHLIB_PATH as described above before starting apache.
Griffel
Advisor

Re: HPWS Apache with PHP and Oracle

Hello Ermin

I have done everything as you it write that way. There is no more error message at the call ldd .../oci8.sl. The apache brings no more error either in the error_log file.
There is an error but if I invoke on the intenet explorer test webfile oracle.php :

Fatal error: Call to undefined function OCILogon() in /opt/hpws/apache/htdocs/oracle.php on line 30

I have put the line extension=oci8.sl and the line extension_dir = /opt/hpws/apache/php/lib/php/extensions in the file php.ini.

Do you have an idea?
Ermin Borovac
Honored Contributor

Re: HPWS Apache with PHP and Oracle

Please make sure ORACLE_HOME is defined (and exported) in the apache startup script.
Griffel
Advisor

Re: HPWS Apache with PHP and Oracle

Yes i have put it. Enclosed means file apachectl.
Ermin Borovac
Honored Contributor

Re: HPWS Apache with PHP and Oracle

It looks like apache didn't load oci8.sl.

Can you create a simple php file that calls phpinfo() and see if oci comes up in the list?

Are there any errors in apache logs?
Griffel
Advisor

Re: HPWS Apache with PHP and Oracle

I have already made this. OCI doesn't occur.
No errors in the apache error_log.
Ermin Borovac
Honored Contributor

Re: HPWS Apache with PHP and Oracle

Sorry, no more suggestions except to double check your php.ini again and make sure oci.sl is uncommented. You have modified the one in /opt/hpws/apache/conf/php.ini, haven't you?
Ermin Borovac
Honored Contributor

Re: HPWS Apache with PHP and Oracle

One more thought ... does file $ORACLE_HOME/JRE/lib/PA_RISC/native_threads/libja
va.sl exist?

What happens when you try this?

$ export SHLIB_PATH=$ORACLE_HOME/lib32
$ LD_PRELOAD=$ORACLE_HOME/JRE/lib/PA_RISC/native_threads/libja
va.sl /opt/hpws/apache/php/bin/php -c /opt/hpws/apache/conf/php.ini -f /opt/hpws
/apache/htdocs/oracle.php
Griffel
Advisor

Re: HPWS Apache with PHP and Oracle

Hello Ermin

I find it this well you have left at the thing.
You have taken me to the right track.

Row extension=oci8.sl isn't commented any more now in php.ini.
$ORACLE_HOME/JRE/lib/PA_RISC/native_threads/libja
va.sl exist.
When i make this LD_PRELOAD=$ORACLE... php -c ...php.ini ...htdocs/oracle.php
then i have new warning of php :" PHP Startup : Unable to load dynamic lbraray '/opt/hpws/apache/php/lib/php/extensions/php_oci8.sl <-- this is wrong, the file php_oci8.sl don`t exist ,
osi8.sl is exist.
File php.ini contains entries ;extension=php_oci8.dll. I have copy the row, unkomment and only change dll in sl. At the first enquiry on ITC, however, I had written the line newly extension=oci8.sl.
The error was still the missing library libclntsh.sl.8.0 here.
The script oracle.php works now.Many Thanks for your help.

A problem still is, if I start php on the commandline. The error message "Can`t open shared library : /CLO/BUILD_ENV/usr/lib/libdld.2".
I only could solve this problem, if I have put a soft link on /usr/lib /CLO/BUILD_ENV/usr/lib .
Ermin Borovac
Honored Contributor

Re: HPWS Apache with PHP and Oracle

To fix the php binary problem all you need to do is enable use of SHLIB_PATH.

# chatr +s enable /opt/hpws/apache/php/bin/php

chatr listing on php binary should now show that use of SHLIB_PATH is enabled (it was previously disabled).

Now make sure you have /usr/lib in your SHLIB_PATH and php should work from the command line as well (and you can also remove link to /CLO/BUILD_ENV ...).

Not sure why this problem exists, but hopefully that works for you.

Griffel
Advisor

Re: HPWS Apache with PHP and Oracle

Has immediately worked. The good tips have helped me very much. Thanks.
Griffel
Advisor

Re: HPWS Apache with PHP and Oracle

Sorry, I have forgotten to assign the points.