Forum Stats

  • 3,826,763 Users
  • 2,260,705 Discussions
  • 7,897,072 Comments

Discussions

ZendServer 6.1.0 on Windows 2012 configuration for local and remote DB

User_BP06J
User_BP06J Member Posts: 3 Red Ribbon
edited Oct 25, 2013 6:08AM in PHP

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!

Tagged:

Best Answer

  • User_BP06J
    User_BP06J Member Posts: 3 Red Ribbon
    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

  • User_BP06J
    User_BP06J Member Posts: 3 Red Ribbon
    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.

  • Christopher Jones-Oracle
    Christopher Jones-Oracle Member Posts: 1,648 Employee

    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."

    Christopher Jones-Oracle
  • User_BP06J
    User_BP06J Member Posts: 3 Red Ribbon

    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");

This discussion has been closed.