PHP - Oracle Connection Problem
669955Nov 12 2008 — edited Nov 21 2008Hi Everyone,
I am trying to connect Oracle database with PHP in Windows enviornment. For that I did the following works.
1) Installed Oracle10g R2 client.
2) Create an SystemDSN in ODBC for the Oracle database and test the connection - working fine.
(ODBC connection is working fine with the Oracle Client installed)
3) Download the latest PHP, PHP 5.2.6 zip package from http://sg2.php.net/downloads.php
4) Copy the files into d:\php\ folder.
5) Create a simple php file to make an odbc connection, test.php in the same php directory, and this is the file content:
<?php
odbc_connect("ebook","ebook123","ebookdev");
?>
6) When I tried to ececute woth php.exe file this is the error message I'm getting....
D:\php>php.exe test.php
Warning: odbc_connect(): SQL error: [Microsoft][ODBC Driver Manager] Data source
name not found and no default driver specified, SQL state IM002 in SQLConnect i
n D:\php-5.2.6-Win32\test.php on line 3
D:\php-5.2.6-Win32>
7) When I uncomment *;extension=php_pdo_odbc.dll* this entry in php.ini and just put the command php on the command line, then it pop up wondows error message box, Same erroe comimg..
8) When I uncmoomnt *;extension=php_oci8.dll and ;extension=php_pdo_oci.dll* then following erroe message appearing on command line.
D:\php>php
PHP Warning: PHP Startup: Unable to load dynamic library './ext/php_oci8.dll' -
%1 is not a valid Win32 application.
in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library './ext/php_pdo_oci.dll
' - %1 is not a valid Win32 application.
in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library './ext/php_pdo_oci8.dl
l' - %1 is not a valid Win32 application.
in Unknown on line 0
Also it pops up wondows error message of, "This application failed to start because OCIW32.dll was not found. Re-installing the application may fix this problem" and "This application failed to start because OCI.dll was not found. Re-installing the application may fix this problem"
Please adwise me to sort out this. How ever I want to get connect the Oracle database (either through ODBC or Direct) by PHP calls.
Thanks..
SURESH
Edited by: user10545483 on Nov 11, 2008 9:30 PM