Discussions
Categories
- 196.9K All Categories
- 2.2K Data
- 239 Big Data Appliance
- 1.9K Data Science
- 450.4K Databases
- 221.7K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 550 MySQL Community Space
- 478 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3K ORDS, SODA & JSON in the Database
- 546 SQLcl
- 4K SQL Developer Data Modeler
- 187.1K SQL & PL/SQL
- 21.3K SQL Developer
- 295.9K Development
- 17 Developer Projects
- 138 Programming Languages
- 292.6K Development Tools
- 107 DevOps
- 3.1K QA/Testing
- 646K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 155 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.1K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 18 Java Essentials
- 160 Java 8 Questions
- 86K Java Programming
- 80 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 204 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 443 LiveLabs
- 38 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 171 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 232 Portuguese
Cannot Connect to Oracle 9i DB Server
Hi,
My problem is, I cannot connect to Oracle 9i DB Server. I tried to run the php_info() and it displays: <br><br>
OCI8 Support enabled <br>
Version 1.2.2 <br>
Revision $Revision: 1.322 $ <br>
Active Persistent Connections 0 <br>
Active Connections 0 <br>
Temporary Lob support enabled <br>
Collections support enabled <br><br>
Directive Local Value Master Value <br>
oci8.default_prefetch 10 10 <br>
oci8.max_persistent -1 -1 <br>
oci8.old_oci_close_semantics 0 0 <br>
oci8.persistent_timeout -1 -1 <br>
oci8.ping_interval 60 60 <br>
oci8.privileged_connect Off Off <br>
oci8.statement_cache_size 20 20 <br><br>
I've got this from error.log in apache server. <br><br>
PHP Warning: ocilogon() [function.ocilogon]: <br>OCIEnvNlsCreate() failed. There is something wrong with your system - please <br>check that PATH includes the directory with Oracle Instant Client libraries in <br>C:\\EID_Web\\Exercises\\connect_to_oracle.php on line 14<br><br>
PHP Warning: ociparse() expects parameter 1 to be resource, boolean given in <br>C:\\Web\\connect_to_oracle.php on line 15<br><br>
PHP Warning: ociexecute() expects parameter 1 to be resource, null given in <br>C:\\Web\\connect_to_oracle.php on line 16<br><br>
PHP Warning: ocifetch() expects parameter 1 to be resource, null given in <br>C:\\Web\\connect_to_oracle.php on line 22<br><br>
PHP Warning: ocifreestatement() expects parameter 1 to be resource, null given in <br>C:\\Web\\connect_to_oracle.php on line 32<br><br>
PHP Warning: ocilogoff() expects parameter 1 to be resource, boolean given in <br>C:\\Web\\connect_to_oracle.php on line 33<br><br>
By the way, I'm using apache server version 2.2.3 and PHP/5.2.0RC6-dev running on <br>windows 2000 as our web server. We have a remote Oracle9i DB Server.<br><br>
Thanks in advance for the help.
My problem is, I cannot connect to Oracle 9i DB Server. I tried to run the php_info() and it displays: <br><br>
OCI8 Support enabled <br>
Version 1.2.2 <br>
Revision $Revision: 1.322 $ <br>
Active Persistent Connections 0 <br>
Active Connections 0 <br>
Temporary Lob support enabled <br>
Collections support enabled <br><br>
Directive Local Value Master Value <br>
oci8.default_prefetch 10 10 <br>
oci8.max_persistent -1 -1 <br>
oci8.old_oci_close_semantics 0 0 <br>
oci8.persistent_timeout -1 -1 <br>
oci8.ping_interval 60 60 <br>
oci8.privileged_connect Off Off <br>
oci8.statement_cache_size 20 20 <br><br>
I've got this from error.log in apache server. <br><br>
PHP Warning: ocilogon() [function.ocilogon]: <br>OCIEnvNlsCreate() failed. There is something wrong with your system - please <br>check that PATH includes the directory with Oracle Instant Client libraries in <br>C:\\EID_Web\\Exercises\\connect_to_oracle.php on line 14<br><br>
PHP Warning: ociparse() expects parameter 1 to be resource, boolean given in <br>C:\\Web\\connect_to_oracle.php on line 15<br><br>
PHP Warning: ociexecute() expects parameter 1 to be resource, null given in <br>C:\\Web\\connect_to_oracle.php on line 16<br><br>
PHP Warning: ocifetch() expects parameter 1 to be resource, null given in <br>C:\\Web\\connect_to_oracle.php on line 22<br><br>
PHP Warning: ocifreestatement() expects parameter 1 to be resource, null given in <br>C:\\Web\\connect_to_oracle.php on line 32<br><br>
PHP Warning: ocilogoff() expects parameter 1 to be resource, boolean given in <br>C:\\Web\\connect_to_oracle.php on line 33<br><br>
By the way, I'm using apache server version 2.2.3 and PHP/5.2.0RC6-dev running on <br>windows 2000 as our web server. We have a remote Oracle9i DB Server.<br><br>
Thanks in advance for the help.
Comments
-
Well, does your PATH environment varaible contain the Instant Client Libraries?
That's what the error message says to check...
~Jer -
I already solved the problem. The problem is incompatability issue with regards to the version of apache, php and oracle. If you are using Oracle9i DB, use PHP version 4.4.4 and Apache version 1.3.35. Don't forget to add the ORACLE_HOME and its path at the Environment Variable tab.
-
I have php 5.1.2 and apache 2.2 with instantclient 10 connected to a 9.2 database and it runs great. So I suppose I disagree with the suggestion to downgrade php and apache.
~Jer -
Ok. I will try to test your suggestion. Thanks for the comment
-
I get this error, i decided to change directory for oracle_home
putenv("ORACLE_HOME=C:/oracle/product/10.2.0/db_1/bin");
to
putenv("ORACLE_HOME=C:/oracle/product/10.2.0/db_1");
it functioned.
my code
<?php
putenv("ORACLE_HOME=C:/oracle/product/10.2.0/db_1");
putenv("ORACLE_SID=PLSExtProc");
$user ="name"; // set user
$senha="password"; // set password
$banco="(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)
(HOST=127.0.0.1)(PORT=1521)
)
)
(CONNECT_DATA=(SERVICE_NAME=orcl))
)"; // configuracoes do banco (isso muda um pouco no oracle)
if ($conexao = OCILogon($user,$senha,$banco))
echo "Conexão bem sucedida.";
else
echo "Erro na conexão com o Oracle.";
?> -
Don't use putenv() with Oracle environment variables - it is error prone and
not portable. See http://www.oracle.com/technology/tech/php/htdocs/php_troubleshooting_faq.html#envvars
-- cj
PS If you had a question, please start a new thread. -
The problem is driver OCI 8 version:
INFO muy práctica y sencilla: Solución: Error driver oci8 en php codigniter con oracle
This discussion has been closed.