Wednesday, January 16, 2008

FAQ : PHP 5.2.5 and Setup php_oci8.dll (oracle 8,oracle 9,oracle 10)



For setup php_oci8.dll or oracle extension in php 5.2.5

Important : PHP 5.2.5 must to use oci.dll in Oracle 10g above.

First download oci.dll (from oracle 10)




Download Now

1.) uncomment line in php.ini

;extension=php_oci8.dll -> change to -> extension=php_oci8.dll

2.) copy oci.dll from downloaded to PHP5.2.5_DIR/ext

3.) check php can load extension module with command :

/>cd c:/php-5.2.5-win32
/>php.exe -m
[PHP Modules]
bcmath
calendar
com_dotnet
ctype
date
dom
filter
ftp
hash
iconv
json
libxml
mysql
oci8
odbc
pcre
Reflection
session
SimpleXML
SPL
standard
tokenizer
wddx
wsf
xml
xmlreader
xmlwriter
xsl
zlib
[Zend Modules]

------ End ---
If you can't find any error or warning ,congratulations!! you succeed to setup oracle extension.
Some problems may be occur in step 3 for example :


  • The procedure entry point OCIStmtPrepare2 could not be located in the dynamic link library OCI.dll, You can fixed this problem by copy oci.dll in oracle10g only to php directory and test again
  • Remember oci.dll in Oracle 8 and Oracel 9 not work with PHP 5.2.5 .
  • The procedure entry point OCILobRead2 could not be located in the dynamic link library OCI.dll, this problem can occur when you copy oci.dll from Oracle 9 to php directory.You can fixed by copy oci.dll in oracle10g only to php_directory and test again
4.) Start Apache or IIS :

Some problems may be occur in step 4 for example :
  • PHP Startup: Unable to load dynamic library 'C:/php-5.2.5-Win32/ext/php_oci8.dll" - The specified procedure could not be found, You can fixed this problem by copy oci.dll (from oracle 10) to apache_home/bin then restart apache again

Today's Joke :

If you can't fixed this problem, please restart you computer now, Ohh my god ... it work fine.


Add to: Power Oldie Add to: Digg Add to: Del.icio.us Add to: StumbleUpon Add to: Yahoo Add to: Spurl Add to: Google

19 comments:

sanakae said...

Hi
tnx this solve
I copy to Oracle8/bin/oci.dll(oracle10) and php5/ext/oci.dll(oracle10). then php.exe -m not prob.
But "Warning: ocilogon() [function.ocilogon]: OCIEnvNlsCreate() failed. There is something wrong with your system - please check that PATH includes the directory with Oracle Instant Client libraries. ?" in used php ? help

Anonymous said...

To Sanakae
1.) Install PHP 5.2.5 and Aapche 2,or Apache 2.2
2.) Config php.ini by uncomment extension=php_oci8.dll
3.) download oci.dll from download link above and copy to php5.2.5/ext directory and apache/bin (without oracle/bin this point your incorect)
4.) test load module by php.exe -m
5.) If load module passed start apache or iis

gkraju_89 said...

hi i have a problem in configuring php 5.2.6 and oracle 10g
i have uncommented lines in php.ini
and copied oci.dll from oracle directory to php5/ext
but it doesnt work
when i type in cmd>prompt it doesnt diplay oci8
help me

Muhammad Amin said...

hi I have problem to connection php with oracle 9i.

But "Fatal error: Call to undefined function ocilogon() in C:\wamp\www\New Folder\oracle.php on line 3" show up.

Please help me

Anonymous said...

The link you gived us SUX. I myst pay for the download or download some kind of software o_0

Anonymous said...

wow it worked like charm! thanks a lot!

cikkim

P@|\| |<@ ] said...

Hi

the things i hv done are

1- install apache http server 2.2
2- php 5.2.5
3-oracle instant client 11_1 at location c://xe client
4- also installed sql plus at location c://xe client
5- make file tnsnames.ora as location c://XE client
6- make TNS_ADMIN enviroment variable having tha path
TNS_ADMIN=c://XE client/tnsnames.ora even i tried c://XE client

i m able to connect the remote oracle server via command prompt, bt when i tried to connect it via php script,is shows the error

[error] [client 127.0.0.1] PHP Warning: oci_connect() [function.oci-connect]: OCIEnvNlsCreate() failed. There is something wrong with your system - please check that PATH includes the directory with Oracle Instant Client libraries in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\phpinfo.php on line 18

not able to understand wat is the error.........tried almost everything......

Pankaj sharma

Anonymous said...

hi
i have installed:
apache 2.2.11
php 5.2.4
mysql 5.1.30
oracle 8i (enterprise edition)

i have copied oci.dll (from 10g) to php/ext and apache/bin
but still it is showing the errors:

1. The procedure entrypoint OCIStmtPrepare2 could not be located in the dynamic link library OCI.dll

2. Unable to load dynamic library 'C:\program files\php\ext\php_oci8.dll'- The specified procedure could not be found.

However i've also uncommented the php_oci8 extension.

:(

Anonymous said...

Thanks a lot. I have gone through many forums, but none has the solution.

Meg said...

Thank you very much, I'm using Oracle 11g client and I was going crazy. I went to several forums and tried everything possible but it was as simple as copying the OCI8.dll from oracle\...\bin and put in the apache\bin and PHP\ext. :)

PHP Training Kolkata said...

It's sensational post. I liked it.
PHP Training

PHP Training said...

Acesoftech is a leading PHP training center which provides best training in Kolkata and Surat. The company provides training in such a way that its easy to learn and complete job oriented. We provide live PHP training.

Anonymous said...

Nice blog

sap upgrades said...

I am using Oracle 11g and is facing a fatal error when trying to set up a connection with remote server. I have downloaded the files and performed all the steps but getting error in step 3.

Anonymous said...

I did all the things mentioned. Copied the oci.dll to both apache/bin and php/ext file. But still I am getting the
"The procedure entrypoint OCIStmtPrepare2 could not be located in the dynamic link library OCI.dll"

Anonymous said...

Acesoftech is No.1 PHP training center in kolkata. Our professional trainer can provide you PHP training in such a way that it will be complete job oriented. So, if you are looking for professional PHP training in Kolkata, acesoftech
is the best choice for you.

Anonymous said...

Thanks this worked. I had tried many things to get the oci8 to work but it did not work. Later when I read your blog, the information regarding copying oci.dll to Apache/bin worked.

Unknown said...

Purpleno is a leading web development consultants based in kolkata, India and we provide complete web solutions on custom php web development by taking care of all aspects of website development services.

PHP training in Chandigarh said...

Thank you for this post. I am waiting for your next post.