note 38349 deleted from oci8.installation by cmb
| From: | cmb@php.net | Date: | Sun, 20 Oct 2019 08:54:12 +0000 |
| Subject: | note 38349 deleted from oci8.installation by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-212707@lists.php.net to get a copy of this message | ||
Note Submitter: lffranco *at* dco dot pemex dot com
----
This took me a lot of time to solve, so I'm placing it here for my future reference, and for
somebody who finds it useful. I don't know if it will work on your environment, this is what I
have:
* Windoze Advanced Server 2003
* IIS 6
* Oracle 8.1.7
So how I configured the whole thing? First do whatever the standard PHP configuration says... it
won't work, anyway... but it will help. I installed PHP on C:\PHP; Oracle Home is in
E:\Oracle\ora817.
* Install Oracle 8 client. NOTE: You must use an Oracle 8 client, I used an Oracle 9 client and for
some reason (dll binding I guess), it didn't work
* Copy $ORACLE_HOME/bin/cli.dll into $WINDOWS/System32
* Modify your SQLNET.ORA file and change the line:
[code]
SQLNET.AUTHENTICATION_SERVICES= (NTS)
[/code]
by this one:
[code]
SQLNET.AUTHENTICATION_SERVICES= (NONE)
[/code]
I dunno WTF NTS is, so if somebody sends me an eMail and explain, I'll be thankful. But if you
don't do this you'll get an ORA-12560 error.
And that's it for Oracle. Now, the IIS configuration:
* Open your IIS Administrator and "Web Service Extensions", add a new extension as
follows:
** Extension Name: PHP
** Required Files (ADD): C:\php\extensions\php_oci8.dll; c:\php\sapi\php4isapi.dll;
c:\WINDOWS\system32\oci.dll
** Check "Set Extension Status as Allowed"
Now you can use your ocli* functions, or better yet, use PEAR::DB functions which was my ultimate
goal, with PEAR::DB you can forget about declaring ORACLE_HOME, ORACLE_SID and all that kind of
things. Just use:
<?php
$dsn = "oci8://scott:tiger@example"
$db = DB::Connect($dsn);
?>