2 Replies Latest reply on Feb 12, 2013 2:28 PM by Justin_Mungal

    PHP and local Oracle database

      I connect to a local Oracle database through ADODB in Excel with connection string "DRIVER={Microsoft ODBC for Oracle}; SERVER=; UID=; PWD=;" and it works fine (I don't know if it's the best way to do it, but it works), but I have problems connecting with PHP. I have a local WAMP installed and have tried with all possible php functions oci_connect(), new PDO(), odbc_connect(), but there seems to be something wrong with my driver.

      I have no experience in connecting to local databases through PHP. Do I need any certificates? Will it be possible to connect to the local Oracle database from a web application (non-local) when I use it on a computer with access to the local database?

      Any help would be appreciated. I'm really interested in learning the relations between the local database and scripts in Excel, PHP and such. Thank you.
        • 1. Re: PHP and local Oracle database

          For connecting to non-local database / from different (client) machine you need to install oracle client software
          Post which you can run netca utility from command prompt to configure TNS entry in $ORACLE_HOME/net/admin/tnsnames.ora which will help you to connect destination DB
          Make sure DB server IP & port are accessible using ping <IP> or telnet <IP> <port>

          Ajay More
          • 2. Re: PHP and local Oracle database
            Using the instant client will probably be the simplest solution.