12c not connect with php see error Call to undefined function oci_connect() [message #659945] |
Mon, 06 February 2017 02:22 |
|
mfahimaamirgmailcom
Messages: 64 Registered: May 2011 Location: pakistan
|
Member |
|
|
sir
I have 12c that run rightly
now i try to connect with PhP
i install
Instant Client Downloads for Microsoft Windows (32-bit)
and
Instant Client Downloads for Microsoft Windows (64-bit)
test both with download and install and set environment variable path
and my php.ini have
;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client
this line already
see my code
<?php
$conn = oci_connect('mfatest', 'testphp', 'localhost/pdborcl'); /==( also i try with 'HOST_IP:PORT/orcl')
$query = 'select EMPNAME from MDAEMPLOYEES';
$stid = oci_parse($conn, $query);
oci_execute($stid, OCI_DEFAULT);
while ($row = oci_fetch_array($stid, OCI_ASSOC)) {
foreach ($row as $item) {
echo $item." | ";
}
echo "
\n";
}
oci_free_statement($stid);
oci_close($conn);
?>
================
<?php
$conn = oci_connect('mfatest', 'testphp', 'localhost/pdborcl'); /==( also i try with 'HOST_IP:PORT/orcl')
$query = 'select EMPNAME from MDAEMPLOYEES';
$stid = oci_parse($conn, $query);
oci_execute($stid, OCI_DEFAULT);
while ($row = oci_fetch_array($stid, OCI_ASSOC)) {
foreach ($row as $item) {
echo $item." | ";
}
echo "
\n";
}
oci_free_statement($stid);
oci_close($conn);
?>
but both code give me this error
see error
Fatal error: Uncaught Error: Call to undefined function oci_connect() in C:\xampp\htdocs\mfamda\test12c.php:2 Stack trace: #0 {main} thrown in C:\xampp\htdocs\mfamda\test12c.php on line 2
please give me idea what is the problem
regard
|
|
|