user3891365 user3891365 - 9 months ago 80
PHP Question

install and configure OCI8 to connect oracle to php

I installed oracle 11g and I did create some tables and manipulate it using sql developer, and I am looking for a way to connect oracle with php on hosting site.

I tried but I get error after using this code:

$Conexion_ID =oci_connect($OracleUser, $OraclePassw, $OracleIP);

this is the error:

Call to undefined function oci_connect()

I've known that I should install and configure OCI8, so I downloaded this file:

but I don't know in which folder should I them to make the connection work well.

Answer Source

Download the PHP Extension from here(Confirm the PHP Version and download for the same, the thread safe[TS] version):

You should be able to find three .dll's

php_oci8.dll, php_oci8_11g.dll and php_oci8_12c.dll

Place all dll's in extension directory, in WAMP it is generally wamp\bin\php\php5.*.*\ext

open the php configuration from the System try of wamp server and add the line:

; Enable only which is required

Restart the Apache server.

EDIT : Sorry I thought the other dll's are the libraries, but instead they are for different oracle versions. In your case enable 11g. Answer updated.

Update 2016-11-07: just wanted to say that latest package can be found here When I wrote this answer 2.0.8 was latest i guess.