Discussions
Categories
- 196.9K All Categories
- 2.2K Data
- 239 Big Data Appliance
- 1.9K Data Science
- 450.3K 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
- 545 SQLcl
- 4K SQL Developer Data Modeler
- 187K 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
- 440 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
ZendServer 6.1.0 on Windows 2012 configuration for local and remote DB

I have installed Zend Server 6.1.0 (PHP 5.4.16 - Apache 2.2.22) on a Win 2012 64 bit server. I need to connect both to a local Oracle 12c (64 bit) server, and to a remote Oracle DB.
Zend Server already contains Oracle client libraries (orannzsbb11.dll, oraocci11.dll, oraociei11.dll, orasql11.dll) and I am able to connect to both the local Oracle DB and the remote one, but only using the full connect identifier inside the PHP script, e.g.
$tns = "(DESCRIPTION =
(ADDRESS=(PROTOCOL = TCP)(HOST = XXX0001)(PORT = 1521))
(CONNECT_DATA=(SERVER = DEDICATED)(SID = ORAXXX)))";
$c = oci_connect("XXXX", "XXXX", $tns);
What I would like is to go through the tnsnames.ora file. I tried installing the full 32 bit Oracle client and also the 32 bit Instant client, but I was not able to make PHP go through the tnsnames.ora. I have set the PATH variable to contain the client libraries in front, and also tried setting the TNS_ADMIN env var, but I was not able to make PHP see the tnsnames.ora.
Do you know how I should set up things to make it work?
Thanks!
Best Answer
-
I have solved this. It was a very trivial problem, I thought that by logging out and back in, the new environment variable would show up, instead a full server restart was needed to see the new env var (I have set ORACLE_HOME). Very stupid problem, but I'm happy I solved it :-) Always look at phpinfo() to see which end vars PHP sees.
Answers
-
I have solved this. It was a very trivial problem, I thought that by logging out and back in, the new environment variable would show up, instead a full server restart was needed to see the new env var (I have set ORACLE_HOME). Very stupid problem, but I'm happy I solved it :-) Always look at phpinfo() to see which end vars PHP sees.
-
Thanks for following up.
I was going to ask about rebooting. Page 84 of The Underground PHP and Oracle Manual points out "Not rebooting is a common source of installation teething troubles."
-
You are perfectly right. Reading the manual is always the best advice. I also re-read the Oracle Client Installation Guide, and if it may be of interest to someone, I also installed the LOCAL env variable, which allows connecting with an empty connection identifier (to the resident DB in my case), e.g.:
$c = oci_connect("XXXX", "XXXX");