473,395 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

oracle_home, oci8 and stored procedure


Hi

I'm having an irritating problem.

I've got php installed with the compile-time flag --oci8=$ORACLE_HOME.

I can make connections to the oracle db no problem. Updating, selecting etc.
is all good.

However, when I use a web page that calls a stored procedure:

$stmt = OCIParse($conn,"begin :result := s30.fn_udicheck('$UDI'); end;");
OCIBindByName($stmt,":result",&$result,32);
OCIExecute($stmt);

I get the following error when viewing the php page in a browser with apache
as the web server:

Warning: ociexecute(): OCIStmtExecute: ORA-06550:
line 1, column 7: PLS-00553: character set name is not recognized
ORA-06550: line 0, column 0: PL/SQL: Compilation unit analysis terminated

My problem is related to the variable $ORACLE_HOME. When I cat my php file
through php from the command line with $ORACLE_HOME set it works. When I
unset $ORACLE HOME I get the error above.

me> export
....
declare -x ORACLE_HOME="/u01/app/oracle/product/8.1.7"
....

me> cat myfile.php | /usr/bin/php * this works *

me> unset $ORACLE_HOME

me> cat myfile.php | /usr/bin/php * this now fails *

I've set $ORACLE_HOME in httpd.conf, php.ini and in the script
itself with putenv. I've also made sure the webserver uid (apache)
has access to all files under $ORACLE_HOME. This all makes no difference.

I've recompiled with LD_LIBRARY_PATH=$ORACLE_HOME/lib too. No joy :(

I hope someone out there can help as this is very frustrating!

Thanks in advance,

--
Ben F

Registered Linux user number 339435
Jul 17 '05 #1
3 6470
Seb
Hi

Did you check the environnement variables through phpinfo ? Is
ORACLE_HOME correctly set and do you need some NLS variable ?

Did you check these variables on server side ?

Seb

Ben Fitzgerald wrote:
Hi

I'm having an irritating problem.

I've got php installed with the compile-time flag --oci8=$ORACLE_HOME.

I can make connections to the oracle db no problem. Updating, selecting etc.
is all good.

However, when I use a web page that calls a stored procedure:

$stmt = OCIParse($conn,"begin :result := s30.fn_udicheck('$UDI'); end;");
OCIBindByName($stmt,":result",&$result,32);
OCIExecute($stmt);

I get the following error when viewing the php page in a browser with apache
as the web server:

Warning: ociexecute(): OCIStmtExecute: ORA-06550:
line 1, column 7: PLS-00553: character set name is not recognized
ORA-06550: line 0, column 0: PL/SQL: Compilation unit analysis terminated

My problem is related to the variable $ORACLE_HOME. When I cat my php file
through php from the command line with $ORACLE_HOME set it works. When I
unset $ORACLE HOME I get the error above.

me> export
...
declare -x ORACLE_HOME="/u01/app/oracle/product/8.1.7"
...

me> cat myfile.php | /usr/bin/php * this works *

me> unset $ORACLE_HOME

me> cat myfile.php | /usr/bin/php * this now fails *

I've set $ORACLE_HOME in httpd.conf, php.ini and in the script
itself with putenv. I've also made sure the webserver uid (apache)
has access to all files under $ORACLE_HOME. This all makes no difference.

I've recompiled with LD_LIBRARY_PATH=$ORACLE_HOME/lib too. No joy :(

I hope someone out there can help as this is very frustrating!

Thanks in advance,

Jul 17 '05 #2
Seb
I've set $ORACLE_HOME in httpd.conf, php.ini and in the script
itself with putenv. I've also made sure the webserver uid (apache)
has access to all files under $ORACLE_HOME. This all makes no difference.


It is not where where you should set it. $ORACLE_HOME should be set in
the startup script of apache either in /etc/init.d/apache (or else) or
in your apachectl script.

You can also set it in the .profile or .bashrc (or else) of the user who
start the apache process.

That should be better. It has nothing to do with httpd.conf or php.ini.

Seb
Jul 17 '05 #3
In article <c1**********@reader1.imaginet.fr>, Seb wrote:
I've set $ORACLE_HOME in httpd.conf, php.ini and in the script
itself with putenv. I've also made sure the webserver uid (apache)
has access to all files under $ORACLE_HOME. This all makes no difference.


It is not where where you should set it. $ORACLE_HOME should be set in
the startup script of apache either in /etc/init.d/apache (or else) or
in your apachectl script.

You can also set it in the .profile or .bashrc (or else) of the user who
start the apache process.

That should be better. It has nothing to do with httpd.conf or php.ini.

Seb


Seb

Thank you!

That did the trick!

I had ORACLE_HOME exported in /etc/profile but this wasn't read on starting
httpd using /sbin/service httpd restart (redhat 8.0).

I've now sourced it in /etc/init.d/httpd

I need to read up more clearly on when different files are read and not read
e.g. .bashrc /etc/profile and by what shells, then I won't have all this
messing around again.

Thanks very much for your help,
--
Ben F

Registered Linux user number 339435
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ollivier Robert | last post by:
Hello, I'm trying to link PHP with Oracle 9.2.0/OCI8 with gcc 3.2.3 on a Solaris9 system. The link succeeds but everytime I try to run php, I get a SEGV from inside the libcnltsh.so library. ...
5
by: peterlin | last post by:
hi, How can I query the $ORACLE_HOME in sqlplus ?
3
by: dinesh prasad | last post by:
I'm trying to use a servlet to process a form, then send that data to an SQL server stored procedure. I'm using the WebLogic 8 App. server. I am able to retrieve database information, so I know my...
0
by: Nashat Wanly | last post by:
HOW TO: Call a Parameterized Stored Procedure by Using ADO.NET and Visual C# .NET View products that this article applies to. This article was previously published under Q310070 For a Microsoft...
2
by: Dino L. | last post by:
How can I run stored procedure (MSSQL) ?
6
by: DravenStone | last post by:
Hi, I had just a horrible day at work, spent pretty much the entire day trying to get php_oci.dll and php_oracle.dll to load. It still never did. Super Quick Background. Jack of all trades IT...
5
by: Mladen Gogala | last post by:
The latest version of OCI8 1.2.1 doesn't work with LOB fields. There was an open bug, but Tony2001 was his usual helpful self, so he removed the bug and flatly denied its existence. I had to...
5
by: danish | last post by:
I download the oci-1.2.2.tgz file and generated the oci8.so file. After adding the extension=oci8.so in php.ini I get the error unable to load dynamic library /usr/lib/php4/oci8.so
0
by: ravinder1983 | last post by:
Hi All, I am new to this world of php. I tried getting oci8 work with php but to no avail. The error i recieve is "Warning: ocilogon() : OCIEnvNlsCreate() failed. There is something wrong with...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.