2 Replies Latest reply: Feb 12, 2013 8:28 AM by Justin_Mungal RSS

    PHP and local Oracle database

    967659
      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
          moreajays
          Hi,

          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>

          Thanks,
          Ajay More
          http://www.moreajays.com
          • 2. Re: PHP and local Oracle database
            Justin_Mungal
            Using the instant client will probably be the simplest solution.

            http://www.oracle.com/technetwork/articles/technote-php-instant-084410.html

            -Justin