1833687 Members
4351 Online
110062 Solutions
New Discussion

PHP+Oracle failure...

 
Scott Nipp
Advisor

PHP+Oracle failure...

I have reviewed a couple of other threads pertaining to this same issue, but niether of these help me out. I am running the HP Apache package A.2.0.52.00 and it ixMySQL package A.04.00-4.0.21. I am getting the following error when I attempt to enable Oracle PHP support following the php.admin.guide that is in the /opt/hpws/apache/hpws_docs directory.

[Thu Mar 24 15:08:28 2005] [notice] SIGHUP received. Attempting to restart
PHP Warning: Unknown(): Unable to load dynamic library '/opt/hpws/apache/php/lib/php/extensions/oci8.sl' - Call to mmap() failed - TEXT /opt/hpws/apache/php/lib/php/extensions/oci8.sl in Unknown on line 0

I am running the Oracle 8.0.6.3 client on this system. This appears to be a 32bit only version as there is no lib32 directory. Any help in resolving this would be much appreciated.

Scott
17 REPLIES 17
Kent Ostby
Honored Contributor

Re: PHP+Oracle failure...

Scott -- I know you said you had looked at a couple of other threads.

This one :

http://forums1.itrc.hp.com/service/forums/bizsupport/questionanswer.do?threadId=543837

deals with your error and suggests setting the SHLIB_PATH .

Is the library in question actually on the system ?

Best regards,

Oz
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Alex Lavrov.
Honored Contributor

Re: PHP+Oracle failure...

If oci8.sl on the system, check if it's the right version of it, because mmap() syscall fails when sl is not compatible.

Reagrds,
Alex.
I don't give a damn for a man that can only spell a word one way. (M. Twain)
Scott Nipp
Advisor

Re: PHP+Oracle failure...

I have set the SHLIB_PATH variable as described in the other thread. This doesn't make a difference at all.

I am not sure on checking the version of the oci8.sl library as someone else suggested. How do I check the version? What version does it need to be? The Oracle home directory was copied from a different working system so I am not sure as to why this wouldn't work.

Thanks again for the help.

Scott
Alex Lavrov.
Honored Contributor

Re: PHP+Oracle failure...

Do you have oracle/oracle client installed on the machine? You must have oracle shared libraries installed, before you enable this extension.
I don't give a damn for a man that can only spell a word one way. (M. Twain)
Scott Nipp
Advisor

Re: PHP+Oracle failure...

I copied the Oracle directory from a working system. This was suggested by the DBA.

Scott
Alex Lavrov.
Honored Contributor

Re: PHP+Oracle failure...

Did you set ORACLE_HOME environment variable so it points to the oracle dir? If not try to set it before you start apache.

And what version of oracle is it?
I don't give a damn for a man that can only spell a word one way. (M. Twain)
Scott Nipp
Advisor

Re: PHP+Oracle failure...

I am running Oracle 8.0.6.3. Yes, the ORACLE_HOME variable has been set.
Alex Lavrov.
Honored Contributor

Re: PHP+Oracle failure...

The question is, does apache aware of this variable. Try to start apache without oracle extension and lod this php page:


In the environment variables, do you see there ORACLE_HOME variable set?


Another very important thing is, look at the first box of phpinfo() output: "Configure Command"

It's the compilation command of php, if you see there '--without-oci8', I'm afraid there is nothing you can do with this php you have, and u'll have to recompile it with '--with-oci8' option.
I don't give a damn for a man that can only spell a word one way. (M. Twain)
Scott Nipp
Advisor

Re: PHP+Oracle failure...

OK... This brings up some interesting information. I am using the HP packages for Apache and MySQL/PHP. In the apachectl file it directs you to uncomment some environment variable exports. I have setup these, but then when I restart the Apache daemons and pull up the phpinfo page I don't see these variables.

Any thoughts on this?
Alex Lavrov.
Honored Contributor

Re: PHP+Oracle failure...

Can you save phpinfo page as html and attach it here? It can be helpful for me to see it.
I don't give a damn for a man that can only spell a word one way. (M. Twain)
Ermin Borovac
Honored Contributor

Re: PHP+Oracle failure...

File /opt/hpws/apache/php/lib/php/extensions/oci8.sl is linked with oracle library libclntsh.sl.8.0. Can you please verify libclntsh library is on your system in $ORACLE_HOME/lib?

$ export SHLIB_PATH=$ORACLE_HOME/lib
$ ldd /opt/hpws/apache/php/lib/php/extensions/oci8.sl

This shouldn't return any errors about missing libclntsh.sl library.
Scott Nipp
Advisor

Re: PHP+Oracle failure...

I ran the commands suggested to test the Oracle library links and it completed without error.

Here is the phpinfo output too...

Scott

Alex Lavrov.
Honored Contributor

Re: PHP+Oracle failure...

I'm afraid php was not compiled with oci support, so there is nothing you can do about, only recompile the whole thing with '--with-oci8' option.
I don't give a damn for a man that can only spell a word one way. (M. Twain)
Scott Nipp
Advisor

Re: PHP+Oracle failure...

This doesn't make a lot of sense to me. This is the HP version and the docs have instructions as to enabling Oracle support by editting the apachctl script. Did HP just make a major blunder in the compiling of PHP?

I don't think this is the case. I believe that I have seen other threads for this same version that people have gotten working.

Scott
Alex Lavrov.
Honored Contributor

Re: PHP+Oracle failure...

If, so, the problem must be that there is no ORACLE_HOME variable defined in apache.

What exactly you did to define it in apache?
I don't give a damn for a man that can only spell a word one way. (M. Twain)
Scott Nipp
Advisor

Re: PHP+Oracle failure...

I setup the ORACLE_HOME variable in the apachectl as per the instructions.

export ORACLE_HOME=/usr/local/oracle/8.0.6.3
#export ORACLE_SID=oradb
export SHLIB_PATH=$ORACLE_HOME/lib:$APACHE_PREFIX/php/lib/php/extensions:$SHLIB_
PATH

I have left the SID blank because the database that I am connecting to actually resides on another server.

Scott
Scott Nipp
Advisor

Re: PHP+Oracle failure...

Stumbled across the answer....

Basically, it had to do with the apachectl script. Unfortunately, I never bothered to actually do an 'apachectl stop' and then an 'apachectl start'. I only ever tested with an 'apachectl restart'. Once I did a full stop and restart everything started working.

Thanks for the help and sorry for the run around.

Scott