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.
When i try to logon with the OCIPLogon function i get the following error message:
Fatal error: Call to undefined function: ociplogon().
Can someone tell me how to install the php_oci8.dll correctly?
Thanx, Albert
Anon
07-05-2000, 07:31 AM
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
Anon
07-10-2000, 10:47 AM
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.
Anon
07-10-2000, 10:55 AM
Just found a dist which PERPORTS to contain the oracle dlls.... downloading now. Check out the URL:
to download and unzip. Found this in a previous message thread here on PHP Builder. I'll post my findings soon (hopefully all goes well :))
Anon
07-11-2000, 04:07 AM
I think the trick is to have oci.dll, which comes with Oracle8i, in the PHP directory. Am I correct???
Anon
07-11-2000, 10:09 AM
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.
Anyone else think of other things to try?
Anon
07-12-2000, 05:42 AM
Any success in getting PHP4+ApacheWin32+OCI working. Please keep us posted. Best of luck to you Andy :-)
Anon
07-12-2000, 10:47 AM
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!
Anon
07-27-2000, 04:19 AM
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 hope it will help you,
Karsten
Anon
07-27-2000, 04:01 PM
It still doesn't work.
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
Anon
07-31-2000, 10:41 PM
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 ???
Sorry for my UGLY English...
Anon
08-02-2000, 11:45 AM
Karsten, thanks for the tip :)
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 :)
Anon
08-21-2000, 12:22 PM
Hi folks,
Any luck with this?
I just checked the latest dlls from php4win.de and Apache still gives a GPF when try to load php as a module with oci extension activated.
Regards
Anon
08-22-2000, 10:20 AM
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.
Anon
08-24-2000, 05:02 AM
Can I recompile php_oci8.dll to make it run with my OCI 8.0.5 ?
If yes, where can I find the source code (for MS VC++) ?
thx
Anon
08-24-2000, 10:25 AM
The source code for all php extensions SHOULD be available through the main php CVS repository. Check on php.net. I'm not sure if the php_oci8.dll can be recompiled for different oracle clients, but it might be worth a try. I don't recompile this myself... I use the compiled binaries available at www.php4win.de (these gents recompile the source code for win32 at every CVS release - currently working with php4.0.2dev). They compile the php_oci8 for oracle 8.1.6, and I'm not sure if the compile works under 8.0.5 - a question better asked of them (they have a contact form on their web page).
As far as I've seen, besides the long BIG download, there's no major reason not to install the 8.1.6 client, as it should connect without difficulty to all previous versions of oracle database servers. And it's free. Any significant reason not to upgrade? (like to know, as I get quite a few questions re: oracle client and php)
Anon
08-24-2000, 12:03 PM
> Any significant reason not to upgrade?
None, except "the big download" vs. a crap 64K line...
Anon
08-25-2000, 07:59 AM
Thanks for your information,
Did all you described, and finally the php_oci8.dll is enabled. Except.....
I can\'t logon. PHP is returning the ORA-message that my credentials are wrong, while using the same connection parameters (scott/tiger@db_alias) as with my PHP/ODBC connection (which works).
Do you recognise this problem?
Anon
08-25-2000, 10:15 AM
What is the full readout of the error message (ORA # and text of message)? Also, can you do a test connection within Net8 to your database? One thing to try, put your connection information in *all lowercase* (sid, username, password). Another, what does you ocilogon call look like (post a cleaned version, without sensitive data)?
With this info, we should be able to track things down further.
Anon
08-28-2000, 03:19 AM
What is the full readout of the error message (ORA # and text of message)?
Also, can you do a test connection within Net8 to your database? One thing
to try, put your connection information in *all lowercase* (sid, username,
password). Another, what does you ocilogon call look like (post a cleaned
version, without sensitive data)?
With this info, we should be able to track things down further.
Here are my ORA messages together with my php script. I can connect to my Oracle 8.1.6 database with net8 (using SQL*Plus).
ORA Messages
------------
Warning: _oci_open_server: ORA-12638: Credential retrieval failed in C:\Inetpub\Homepage\oci.php on line 10
Warning: Supplied argument is not a valid OCI8-Connection resource in C:\Inetpub\Homepage\oci.php on line 11
Warning: Supplied argument is not a valid OCI8-Statement resource in C:\Inetpub\Homepage\oci.php on line 12
Warning: Supplied argument is not a valid OCI8-Statement resource in C:\Inetpub\Homepage\oci.php on line 13
<?php
$c1 = ociplogon("scott", "tiger", "alias");
$stmt = ociparse($c1, "select * from links order by link");
ociexecute($stmt);
while(ocifetch($stmt))
printf("<P>".ociresult($stmt, "link")."</P>\n");
?>
</body>
Anon
08-28-2000, 03:21 AM
What is the full readout of the error message (ORA # and text of message)?
Also, can you do a test connection within Net8 to your database? One thing
to try, put your connection information in *all lowercase* (sid, username,
password). Another, what does you ocilogon call look like (post a cleaned
version, without sensitive data)?
With this info, we should be able to track things down further.
Here are my ORA messages together with my php script. I can connect to my Oracle 8.1.6 database with net8 (using SQL*Plus).
ORA Messages
------------
Warning: _oci_open_server: ORA-12638: Credential retrieval failed in C:\Inetpub\Homepage\oci.php on line 10
Warning: Supplied argument is not a valid OCI8-Connection resource in C:\Inetpub\Homepage\oci.php on line 11
Warning: Supplied argument is not a valid OCI8-Statement resource in C:\Inetpub\Homepage\oci.php on line 12
Warning: Supplied argument is not a valid OCI8-Statement resource in C:\Inetpub\Homepage\oci.php on line 13
<?php
$c1 = ociplogon("scott", "tiger", "alias");
$stmt = ociparse($c1, "select * from links order by link");
ociexecute($stmt);
while(ocifetch($stmt))
printf("<P>".ociresult($stmt, "link")."</P>\n");
?>
</body>
ORA Warnings
------------
Warning: _oci_open_server: ORA-12638: Credential retrieval failed in C:\Inetpub\Homepage\oci.php on line 10
Warning: Supplied argument is not a valid OCI8-Connection resource in C:\Inetpub\Homepage\oci.php on line 11
Warning: Supplied argument is not a valid OCI8-Statement resource in C:\Inetpub\Homepage\oci.php on line 12
Warning: Supplied argument is not a valid OCI8-Statement resource in C:\Inetpub\Homepage\oci.php on line 13
Anon
10-02-2000, 07:31 PM
I ran into this problem running apache and the problem was that the webserver was running on the command line...it needs to be running as a service or as a module to apache or IIS4. then it will register all the enviroment variables
Anon
03-19-2001, 11:45 AM
Albert,
I can only sympathise, I have now spent 6 hours today messing with the same dll problem.
I have the following line in the php.ini file
extensions_dir=c:\php\extensions\ (must have the trailing \)
You can then have your extension=php_oci8.dll or whatever the extension is.
This all seemed like the solution but still got the error about missing oci.dll As I speak I am installing the Oracle 8i client and one of the options within this is to install the 'Oracle Command Interpreter 8'. I am hoping this solves the problem. If it does I will let you know ASAP.
Mark
Anon
02-15-2002, 10:06 AM
test
Anon
02-28-2002, 05:00 AM
Hi All,
I have successfully set up the PHP4+APACHE+OCI8 on a W2K machine, but I get the """"Supplied argument is not a valid OCI8-Connection resource """" error message and am unable to do anything further.
I have no problems if I do an execute query immedietly after connecting, but the next enter query and execute query fails with the above WARNINGS.
Has anyone progressed beyond this part?
In case some of you still have problems in setting up the env, mail me and I can send you a copy of all the things u need to set up the env.
Really pissed off at myself that I have been stuck in a single problem for the last 2 weeks and have re-written my code atleast 4 times so far.
TIA!
Cheers
PHP Builder
Copyright WebMediaBrands Inc. All Rights Reserved.