I am new with PHP I would like to connect my PHP page with Oracle 9i Database and for that i am using following codes. I am Using PHP Version 5.2.5 with IIS version 5.1 and internet Explorer version 6.
When I run my PHP page I got error PHP Fatal error: Call to undefined function OCILogon().
I had search a lot of thing but still fail to resolve this error. Please help me what i need to do...
<?php
$conn = OCILogon("scott","tiger", "ferhat");
$stmt = OCIParse($conn,"select * from emp where empno > :emp order by empno");
$emp = 7900;
OCIBindByName($stmt, ':emp', $emp);
$ok = OCIExecute($stmt);
while (OCIFetchInto($stmt,$arr)) {
print_r($arr);
echo "<hr>";
}
?>
Last edited by Benjamin on Fri Nov 18, 2011 6:52 am, edited 1 time in total.
Reason:Added [syntax=php||htm||css||javascript||sql||etc] - Please use [syntax] tags when posting code in the forums! Thanks.
Welcome to DevNetwork. The error message is telling you that it was unable to find the function named OCILogon() that you called. Ordinarily, that would be probably be in an "include file", a separate file that must be on your server and that you must reference in this script with something like this:
Thanks for your prompt reply but the thing is that where do i get 'OCI.INC' file i had searched the same on my computer and not able to find. Also let me know where do i copy the same file if i download the same form somewhere.
califdon wrote:Welcome to DevNetwork. The error message is telling you that it was unable to find the function named OCILogon() that you called. Ordinarily, that would be probably be in an "include file", a separate file that must be on your server and that you must reference in this script with something like this:
I am using Windows XP with IIS 5.1. Can you tell me what i need to do to enabled oci 8 Support. Also let me know which DLL's are required as i am using IIS instead of Apache
emmbec wrote:What OS do you have PHP installed on?
If it is on Windows you need to add some DLL's to the apache/bin folder.
Also check in your PHPINFO that you have the following section:
I had tried to search oraiisp8.dll file on my computer / where IIS running but unabled to find the above said file on both Client folder C:\ORAXP\BIN also on my oracle home folder (Server) "O:\ORANT\BIN".
Kindly let me know from where do i download or installed that file on my computer
Thanks
emmbec wrote:You need the oracle DLL's that are found in your oracle installation. You need to enable OCI8 support in your php.ini file.
To see how to configure Oracle with IIS take a look at the following page:
Also i tried to make connection by using following codes as you advise me but still getting the same error Call to undefined function OCILogon() . here is my codes
Last edited by Benjamin on Fri Nov 18, 2011 6:52 am, edited 1 time in total.
Reason:Added [syntax=php||htm||css||javascript||sql||etc] - Please use [syntax] tags when posting code in the forums! Thanks.
Well i had do the same as you advised me in your both messages. But still having same error.
I would like to know that you advise me to use extension_dir = "c:/php/ext" instead of extension_dir = "c:\php\ext". Plz help me....
Following are the codes and php.ini settings for your consideration
; Directory in which the loadable extensions (modules) reside.
extension_dir = "c:/php/ext"
extension=php_oci8.dll
extension=php_oracle.dll
Last edited by Benjamin on Fri Nov 18, 2011 6:52 am, edited 1 time in total.
Reason:Added [syntax=php||htm||css||javascript||sql||etc] - Please use [syntax] tags when posting code in the forums! Thanks.
If you don't have the DLL's you are never going to get oracle working. Find those DLLs and put them in your extension folder. I usually find them where I installed oracle.
if you talk about oraiisp8.dll then i could not find the same file on my machine. If you suggest that i again installed oracle client on my machine the plz let me know in customize installation which option i want to use to get the same file.
And if you talk about php_oci8.dll and php_oracle.dll the i would like to inform you that i already copied both file in php\ext dirctory and also i already mention/ enabled the same in
Thanks
emmbec wrote:If you don't have the DLL's you are never going to get oracle working. Find those DLLs and put them in your extension folder. I usually find them where I installed oracle.