How to connect php to oracle database

install xammp v3.2.2 and PHP Version 5.6.31 iam try to connect oracle 12c version 12.1.0

i change php.inc file remove semicolan extension=php_oci8_12c.dll this extension

set path in envirnment variable instance client 12.1.0 oracal official instance client i use 64 bit windows 7 xammp 32 bit version i download 32 bit instance client

download php_oci https://pecl.php.net/package/oci8/2.0.8/windows in this link download php 5.6 version

iam facing this error Fatal error: Call to undefined function oci_connect() in C:\xampp\htdocs\test\con1.php on line 4

error1

error in this line $conn=oci_connect(“trainee17”,“TRAINEE17”,“192.168.0.193/ demo”);

i use this php code

<html>
<head><title>Oracle demo</title></head>
<body>
    <?php
    $conn=oci_connect("username","password","localhost/service_name");
    If (!$conn)
        echo 'Failed to connect to Oracle';
    else
        echo 'Succesfully connected with Oracle DB';
 
oci_close($conn);
?>
 
</body>
</html>

error 2

facing another error the procedure entry point OCIStmt get next result could not be located in the dynamic link library OCI.dll

You need to enable the extension in your php.ini file

;extension=php_oci8.dll
;extension=php_oci8_11.g.dll  

I thought OP had done that:

I knew they said php.inc, I imagined that was a typo. Am presuming they have also restarted since.

I wondered whether reading through the ‘Requirement’, ‘Installation’ and ‘Testing’ section that starts here might help: http://php.net/manual/en/oci8.requirements.php

i remove that again same error try to connect 12c databse not 11g

tel me clearly any tutorial to connect correct method to connect php to oracle database new error driver not found tel me

Did you read through the documentation I posted above?

I’ve never tried this, don’t have a copy of Oracle to test with, so can offer nothing other than the official documentation page which, on a quick glance, seemed to have more steps than you outlined in your original post.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.