Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

oci8 problems from pear build

user567192Mar 31 2007 — edited Apr 1 2007
ok, so i got the bright idea of building oci8 via php-pear. seems to go very well, module builds and loads into php ok, my only real problem seems to be the oci8 environment does not know the oracle environment. i built against standard oracle client. the phpinfo report on oci8 looks like this:

oci8

OCI8 Support => enabled
Version => 1.2.3
Revision => $Revision: 1.269.2.16.2.29 $
Active Persistent Connections => 0
Active Connections => 0
Oracle Version =>
Compile-time ORACLE_HOME =>
Libraries Used =>
Temporary Lob support => enabled
Collections support => enabled

Directive => Local Value => Master Value
oci8.default_prefetch => 10 => 10
oci8.max_persistent => -1 => -1
oci8.old_oci_close_semantics => 0 => 0
oci8.persistent_timeout => -1 => -1
oci8.ping_interval => 60 => 60
oci8.privileged_connect => Off => Off
oci8.statement_cache_size => 20 => 20

the apache env looks like this with respect to ORACLE and LD:

php phpinfo.php | grep ORA
PHP Warning: Module 'PDO' already loaded in Unknown on line 0
Compile-time ORACLE_HOME =>
ORA_CRS_HOME => /opt/oracle/product/10gR2/crs
ORA_ASM_HOME => /opt/oracle/product/10gR2/asm
ORACLE_SID => orcl
ORACLE_BASE => /opt/oracle
ORACLE_HOME => /opt/oracle/product/10.2/db_1
SERVER["ORACRS_HOME"] => /opt/oracle/product/10gR2/crs
_SERVER["ORA_ASM_HOME"] => /opt/oracle/product/10gR2/asm
_SERVER["ORACLE_SID"] => orcl
_SERVER["ORACLE_BASE"] => /opt/oracle
_SERVER["ORACLE_HOME"] => /opt/oracle/product/10.2/db_1

PHP Warning: Module 'PDO' already loaded in Unknown on line 0
safe_mode_protected_env_vars => LD_LIBRARY_PATH => LD_LIBRARY_PATH
LD_LIBRARY_PATH => /opt/oracle/product/10.2/db_1/lib
OLDPWD => /root
_SERVER["LD_LIBRARY_PATH"] => /opt/oracle/product/10.2/db_1/lib
_SERVER["OLDPWD"] => /root

clearly the oci8 module knows the correct oracle env:

ldd /usr/lib64/php5/extensions/oci8.so
libclntsh.so.10.1 => /opt/oracle/product/10.2/db_1/lib/libclntsh.so.10.1 (0x00002aef92f79000)
libc.so.6 => /lib64/libc.so.6 (0x00002aef94412000)
libnnz10.so => /opt/oracle/product/10.2/db_1/lib/libnnz10.so (0x00002aef94754000)

the oracle client can make connections to the remote DB but the apache/oci8 connections fail with:

[Fri Mar 30 22:00:52 2007] [error] [client xxx.xxx.xxx.xxx] PHP Warning: ocilogon(): OCIEnvNlsCreate() failed. There is something wrong with your system - please check th
at ORACLE_HOME is set and points to the right directory in /srv/www/htdocs/phpdb2.php on line 3

where line 3 pf the php script is:

$conn = OCILogon("USER", "PW", "//xxx.xxx.xxx.xxx:1521/XXX");

looks to me like its very close to working, but i must be missing something simple that i cannot see :-\ thanks for any help!

-- michael

ps, i realized some php specifics may be in order:

rpm -qa | grep php
php5-pear-5.2.0-12
php5-5.2.0-12
php5-devel-5.2.0-12
apache2-mod_php5-5.2.0-12
php5-zlib-5.2.0-10
php5-pear-db-1.7.6-42
php5-pdo-5.2.0-10
mus:/srv/www/htdocs # rpm -qa | grep apache
apache2-prefork-2.2.3-20
apache2-worker-2.2.3-20
apache2-mod_php5-5.2.0-12
apache2-2.2.3-20

and this is on openSUSE 10.2 x86_64.

Message was edited by:
user567192
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 29 2007
Added on Mar 31 2007
1 comment
4,678 views