ARG! Unable to connect to 10.2.0.1 Oracle database

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am having problems connecting to Oracle 10.2 (64-bit) on Solaris 9 using
Apache 2.0.54 and PHP 5.0.5

PHP Build:
./configure --prefix=/usr/local/php-5.0.4--with-apxs2=/usr/local/apache2/bin/apxs
--enable-cli --enable-cgi
--with-zlib --with-zlib-dir=/usr/local/lib --with-bz2 --with-gd
--with-mysql=/usr/local/mysql --with-mysql-sock=/tmp/mysql.sock
--enable-sockets --with-oci8=/u01/app/oracle/product/10.2 --enable-debug

After configuring I had to edit the Makefile and change all references of
$ORACLE_HOME/lib to $ORACLE_HOME/lib32


My config:
In tnsnames.ora:
ADCDM02 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =
adcinfops01.mydomain.com<http://adcinfops01.mydomain.com>)(PORT
= 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = adcdm02.mydomain.com <http://adcdm02.mydomain.com>)
)
)

ADCDM02_SID =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =
adcinfops01.mydomain.com<http://adcinfops01.mydomain.com>)(PORT
= 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SID = adcdm02)
)
)

In $apache_home/bin/apachectl:
ORACLE_HOME=/u01/app/oracle/product/10.2
ORACLE_SID=adcdm02 (I also tried TWO_TASK=ADCDM02)

In $apache_home/conf/httpd.conf
SetEnv ORACLE_HOME /u01/app/oracle/product/10.2
SetEnv ORACLE_SID adcdm02
SetEnv TNS_ADMIN /var/opt/oracle

Here is my code that is not working:
//putenv("ORACLE_SID=adcdm02");
putenv("TWO_TASK=ADCDM02_SID");
putenv("ORACLE_HOME=/u01/app/oracle/product/10.2");
putenv("LD_LIBRARY_PATH=/u01/app/oracle/product/10.2/lib32:/u01/app/oracle/product/10.2/lib:/usr/local/lib:/usr/local/git/lib");

$ora = oci_connect("dm","c4milez", "ADCDM02_SID");

$stmt=OCIParse($ora, "select USERNAME from dba_users");

Here is the error:
*Warning*: oci_connect()
[function.oci-connect<http://adcinfops01/function.oci-connect>]:
_oci_open_session: OCIHandleAlloc OCI_HTYPE_SVCCTX: OCI_INVALID_HANDLE in *
/usr/local/httpd-2.0.54/htdocs/oratest.php* on line *8*

*Warning*: ociparse(): supplied argument is not a valid OCI8-Connection
resource in */usr/local/httpd-2.0.54/htdocs/oratest.php* on line *10

*Anyone have any ideas? The exact config worked fine with Oracle
10.1.0.4.....
Thanks,CC

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux