cancel
Showing results for 
Search instead for 
Did you mean: 

PHP with Oracle problem

Fadia Almarei
Super Advisor

PHP with Oracle problem

Dear All
i have Redhat Enterprise Linux v.4 As,i install on it Apache 1.3.33 and php-4.4 and oracle 10g v.2 ,i run the apache and t is good i try to try a PHP file and it works , but when i try a cript which connect to the oracle DB it gives me the following error
"ocilogon(): _oci_open_server: Error while trying to retrieve text for error ORA-12546 "
i see that it is permission error but i do not know what to do, the apache installed as a root user and it runs as a nobody user, kindly help.
BR,
Fadia
fadia.marei
8 REPLIES
Alex Lavrov.
Honored Contributor

Re: PHP with Oracle problem

It seems that oracle client is not configured right on your box. Ususally you get this message when it doesn't find the files of oracle client, so it can't fetch the description of the errors.

Do you have oracle client files on this server?

create php file "phpinfo.php" with this code:


And run it. Check if you see OCI support enabled. If not, it seems that you should compile PHP with OCI libraries.

Alex.
I don't give a damn for a man that can only spell a word one way. (M. Twain)
Fadia Almarei
Super Advisor

Re: PHP with Oracle problem

i do not have oracle client , the oracle server and the PHP in the same server.
fadia.marei
Alex Lavrov.
Honored Contributor

Re: PHP with Oracle problem

OK, it's even better. What about "phpinfo.php" output?
I don't give a damn for a man that can only spell a word one way. (M. Twain)
Steven E. Protter
Exalted Contributor

Re: PHP with Oracle problem

There is definitely an integration issue with Oracle.

Oracle ships this product with its own port of apache with special extensions made to give database access.

The error code you are getting is pretty generic and pretty much shows that Oracle is not really sure whats wrong, but something is wrong.

General advice here is that if possible its better to use the products that Oracle has integrated instead of what ships with Linux. Their httpd server will use a different port and will co-exist nicely with the apache that ships with the OS.

The PHP script itself probably has an environment variable thats pointing to the wrong apache server or binaries and I'd look at the script carefully and see if there is a problem there.

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
Alex Lavrov.
Honored Contributor

Re: PHP with Oracle problem

Oh, right, it's been a while I did it.

Now that SEP brought up the environment issue.

Check if the ORACLE_HOME environment set in apache, I bet this is the problem.

Alex.
I don't give a damn for a man that can only spell a word one way. (M. Twain)
Fadia Almarei
Super Advisor

Re: PHP with Oracle problem

Dear Alex
the ORACL_HOME variable set ccorrectly before i start the apache, i install apache in /opt/apache filder , if you can send me a php script to connect to oracle and i will try it.
fadia.marei
Alex Lavrov.
Honored Contributor

Re: PHP with Oracle problem

You can see samples here:

http://il.php.net/manual/en/ref.oci8.php


But according to your error, something is wrong, so if you want to help us help you, it will be very helpfull to attach an output of script :)
I don't give a damn for a man that can only spell a word one way. (M. Twain)
Fadia Almarei
Super Advisor

Re: PHP with Oracle problem

thanks for your help Alex,the php script in the attachment
fadia.marei