To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
I have installed php4 within IIS on a win32 platform (not my choice). Now i like to call my Oracle database with the OCI functions from PHP4. Because i don't have a C compiler i took a precompiled php_oci8.dll from the internet and placed it in my winnt\system32 directory and changed my extension settings in my php.ini file.
Hi,
Sorry for not answering you what you are looking for, because i´m trying to do the same. But please, could you tell me where did you find the php_oci8.dll?
Thanks
Sergio
P.D. may be this address could help both of us
http://pulsar.jb.com/sklar-php/code83.html
I am also looking for a copy of php_oci8.dll for PHP4... If I can get a copy of this precompiled DLL, I'm sure it would be easier for all of us to figure out any issues with installing/configuring this PHP extension. I'm running Apache 1.3.12 on NT 4.0 (SP5) with PHP 4.0.1 PL2. PHP runs like a champ but without the oci dll, no oracle connection :( Hey, even if I got source code, I would TRY (emphasis on try) compiling it. Worth a shot.
Yes, there is mention of having the oci.dll together with the compiled php_oci8.dll. I believe that is a must... however, I'm having trouble getting the php_oci8.dll (or even php_oracle.dll for that matter) to load correctly within my php4.0.1pl2 installation. When I copy the dlls into my extenstions directory (same dir as php.exe) and then add the appropriate "extension=php_oci8.dll" line to my php.ini file (in the WINNT directory), I get an error message from php4ts.dll (I'm running under Apache 1.3.12). PHP.EXE hangs in memory (cannot terminate in the task list).
But, if I re-comment the extension line out, then PHP runs okay. All I'm calling in my test page is phpinfo(). Perhaps I need some additional section code specifically for the oracle extensions, but not sure.
I did notice that certain parts of PHP are VERY version specific... I downloaded an earlier Beta of Zend Optimizer, and when I added this to my php.ini, I got a similar (though not exactly the same) error message. But, once I got a new version of the optimizer, and installed it in the same manner, it ran fine.
I'm coming to the conclusion that in order to get this stuff to work right, you need either 1) a pre-compiled version of php_oci8.dll that is compiled with a particular version of php (when they release subsequent win32 binaries), or 2) re-compile the whole thing yourself.
I do have the latest source code for the php_oci8 extension, so I'm going to TRY (much emphasis) compiling everything myself, and see where that goes.
I'll let ya know... I'm in the middle of trying to get my devel environment right (with SQL*Net, etc.)... unfortunately, looks like the easiest way to get these compiled is with MS VC++, but I don't have a copy (probably going to order it tomorrow :))
But I'll be trying this with Borland Compiler 5.5 (free version) and also with Cygwin (to see which one may work better) and I'll certainly keep you all posted.
Ah, to be digging through hardline code once again!
Here are a part of a script you must insert in the first Lines of your Script:
dl("php_oci8.dll"); //important
putenv("ORACLE_SID=orcl"); //important
$conn=ocilogon("Scott","Tiger");
I've placed the PHP-files in C:\WINNT\PHP, have my Oracle 8.1.6 DB installed on the same server.
Then I've placed the PHP.INI file in C:\WINNT\ and made sure the following 2 lines were included:
extension_dir = ./ (also tried ./winnt/php)
extension = php_oci8.dll (also tried without)
extension = oci.dll (also tried without)
Off course I restarted the IIS-service with:
net stop iisadmin
net start w3svc
which produced this output:
Test...
Fatal error: Unable to load dynamic library './/php_oci8.dll'
The specified module could not be found.
I also tried to replace the dl("php_oci8.dll) with ("oci.dll") which resulted in:
Test...
Warning: Invalid library (maybe not a PHP library) 'oci.dll' in Unknown on line 0
Fatal error: Call to undefined function: ocilogon() in ...
So, I guess it's some wrong compiled library.
Anybody figures what is going wrong?
Thanks in advance,
Walter
hi all,
I encountered the same problem too...sigh
So, at last , I recompiled all the PHP4.0.1pl2 under the instruction from php doc. The compilation seems has some tiny
warning, but it done at last...:-).
The first compilation is a Debug_TS version, which work ok with OCI8. The configuration is something like this:
extention=php_oci8.dll
extention_dir=f:\php-4.0.1pl2\Debug_TS
The phpinfo() show the correct result-- oci8
supported. Then I tried the PHPLIB7.2b which
use db_oci8.inc as the CT_Sql , it work ok.
the DB_Example class has a database "oracle151" which is the service name of my oracle server net8 configure.No
ORACLE_SID needed at my client side.
Then , I tried to recompiled all into a
Release version. But....After all compilation
done, and fix the httpd.conf and php.ini,
the same error appeared again!....
TNS error : service can't resolve
( some matter like this :-( )
seems that the php_oci8.dll can't not pass
the correct service name to oci8.dll....
then , I tried to ommit the database in DB_Example(just let it empty),then php CAN
connect to my local oracle server ....ODD!!..
SIGH....I tried to add some message in the
oci8.c to see whether the corrected string has been passed? It does. Nothing ODD in the
oci8.c code...(??!!)..
At last , the results are:
1. PHP4.0.1pl2 Debug_TS version all goes well.
2. PHP4.0.1pl2 Release_TS version only can
do with empty service name.( NO REMOTE server
support!??)
Maybe the thread safe feature can't work
well with OCI8.dll ???
Well, I've finally located a pre-compiled version of PHP on the web WITH most of the dlls attached (including OCI and a host of others) - this is a 4.0.2dev compilation so be wary.
http://www.mm4.de/andreas.otto/php_related
I'm still having some trouble with the php_oci8.dll however. I get all my other fun extensions working simply from the supplied dlls (ftp, ldap, zlib), but as soon as I un-comment "extension=php_oci8.dll" in my php.ini, my Apache server craps out (PHP hangs as a process in memory).
My extensions dir is the same as php.exe (c:\phpdev). I've copied the supplied oci.dll into that same directory. I've also copied the supplied php_oci8.dll into my *system32* directory (got a tip on this from the php-windows list on php.net). Apache 1.3.12 on NT 4 SP5 as CGI (not apache module).
So, do I need something else? I don't have oracle installed locally, but up on a network drive... should I have something added to my path to point to this oracle installation? Do I need some additional settings in my include_path of php.ini? Am I missing some [section] code specific to OCI8? Any answers would help.... specifically, if anyone HAS gotten php_oci8.dll to work, specifically how are your files setup (directory locations, etc.)? Hope to get this all worked out soon, and get on with development work :)
As we've worked this through here 8 ways from Sunday... there are a few KEY points which you need to check to get the oci8 extension to work correctly, in either CGI or Apache mod mode.
1) MOST IMPORTANT: you *must* have the latest version of the oracle client software installed on the server... Oracle Client 8.1.6 is what was used when compiling the php_oci8.dll. The extension is very specific to this version of client drivers/software. This is a free (though VERY BIG) download from technet.oracle.com (~170 MB).
2) Are you using the full set of files from php4win.de? Again, extensions are also specific to a compiled version of php4... if you want to use their php_oci8, then you also have to run THAT compiled version of php4.0.2dev. Also, bear in mind that this is a development compilation, not a production release.
3) Can you connect to your oracle database through other software, such as ODBC... also, can you successfully test your database connection inside Net8? This will help to narrow any problems you're having down to either oracle itself, or to php4/apache/php_oci8.