php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35572 Error while trying to retrieve text for error ORA-12154
Submitted: 2005-12-06 17:21 UTC Modified: 2005-12-06 19:05 UTC
From: lauris at nix dot lv Assigned:
Status: Not a bug Package: OCI8 related
PHP Version: 5.1.1 OS: Mandriva Linux 2006
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: lauris at nix dot lv
New email:
PHP Version: OS:

 

 [2005-12-06 17:21 UTC] lauris at nix dot lv
Description:
------------
When connection to Oracle database I get following errors:
"Error while trying to retrieve text for error ORA-12154".
I have Oracle 10g client installed and SQL*plus is working fine. Also php-oci8 extension is loading without any warnings or errors.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-06 17:25 UTC] tony2001@php.net
Most likely that means that you didn't set ORACLE_HOME or set it to a wrong dir.
 [2005-12-06 17:30 UTC] lauris at nix dot lv
phpinfo() returns:
...
oci8
OCI8 Support 	enabled
Revision 	$Revision: 1.269.2.3 $
Active Persistent Links 	0
Active Links 	0
Oracle Version 	no value
Compile-time ORACLE_HOME 	no value
Libraries Used 	no value
Temporary Lob support 	enabled
Collections support 	enabled 
...
PHP Variables
Variable	Value
_SERVER["ORACLE_HOME"]	/opt/oracle/OraHome_1/
_SERVER["LD_LIBRARY_PATH"]	/opt/oracle/OraHome_1/lib/
_SERVER["NLS_LANG"]	LATVIAN_LATVIA.BLT8CP921

ORACLE_HOME is set to right direcotry. I'm stuck with this problem for weeks and have no idea what to do :(
 [2005-12-06 17:35 UTC] tony2001@php.net
Remove the trailing slash, restart the web-server and try again.
 [2005-12-06 17:47 UTC] lauris at nix dot lv
Did so and it did not help.
I have following enviroment variables set:
export ORACLE_SID=/opt/oracle/OraHome_1
export TNS_ADMIN=/opt/oracle/OraHome_1/network/admin
export ORACLE_OWNER=oracle
export ORACLE_HOME=/opt/oracle/OraHome_1
export PATH=$PATH:$ORACLE_HOME/bin/
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export NLS_LANG=LATVIAN_LATVIA.BLT8CP921

ls -la /opt/oracle/OraHome_1/network/admin/tnsnames.ora
-rw-r--r--  1 oracle oracle 3207 Aug 25 19:23 /opt/oracle/OraHome_1/network/admin/tnsnames.ora

So tnsnames.ora is readable to all.
And still I'm getting the same error :(
What more info I can provide?
 [2005-12-06 18:02 UTC] lauris at nix dot lv
Just tried connecting to database when database name is in format "//host:port/service_name" and now oci_connect returns false and also oci_error returns false. Realy have no ideas what to do...
 [2005-12-06 18:07 UTC] tony2001@php.net
Did you try it with PHP CLI ?
 [2005-12-06 18:11 UTC] lauris at nix dot lv
just tried running with php cli and it working. So whats wrong with my configuration?
 [2005-12-06 18:15 UTC] lauris at nix dot lv
even if I su as apache user and run php cli it's working fine.
 [2005-12-06 18:33 UTC] tony2001@php.net
What was your ./configure line?
 [2005-12-06 18:52 UTC] lauris at nix dot lv
I built it using spec file where %{modname} is oci8

phpize
%configure2_5x \
    --with-%{modname}=/opt/oracle/OraHome_1/ \
    --enable-sigchild

so configure would look like:
phpize
./configure \
    --with-oci8=/opt/oracle/OraHome_1/ \
    --enable-sigchild
 [2005-12-06 18:57 UTC] lauris at nix dot lv
recompiled with and it did not help
./configure \
    --with-oci8=/opt/oracle/OraHome_1 \
    --enable-sigchild
 [2005-12-06 19:05 UTC] tony2001@php.net
So you've built OCI8 with Oracle server and it's pointless to use "//host:port/service_name" syntax that is available only in Oracle Instant Client.
Since it works in CLI -> not PHP oroblem, you have some mess with environment variables and/or privileges.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 26 22:00:03 2025 UTC