RE: [PHP] Oracle, Win2000, Apache, OCI
| From: | Brooks, Ken | Date: | Thu, 22 Mar 2001 13:57:20 +0000 |
| Subject: | RE: [PHP] Oracle, Win2000, Apache, OCI | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-45117@lists.php.net to get a copy of this message | ||
Thanks guys. I'm going to try and tackle this later today.
I was soooo happy just to get ODBC and oracle working yesterday.
I had to install the oracle 8.1.6 client.
Then i rolled back to php3.
Works fine.
I'm going to try the OCI stuff later, i'll letcha know.
-ken
-----Original Message-----
From: Greig, Euan [mailto:Euan.Greig@brann.com]
Sent: Thursday, March 22, 2001 5:37 AM
To: php-general@lists.php.net
Subject: [PHP] Oracle, Win2000, Apache, OCI
< I have seen -many- messages and spent an entire day reading, and haven't
< found
< what I'm looking for so i hope this is the correct place to ask.
< When I try to make an ora_logon or ocilogon, I get
< the error: Fatal error: Call to undefined function: ora_logon()
< Is this an incorrect PHP setup or is this due to the fact that I don't
have
< Oracle 8.1.6 installed?
< (I have 7.x)
< I have uncommented the php_oracle and php_oci8.dll lines in the php.ini
< file. Do I need to do more than that?
< (I am using the latest php4 windows binary).
I too have had a lot of "fun" with this. I seem to have finally got it
cracked, with help from this list, and from searches on the web.
First, have you checked the setting of your extension directory in php.ini?
It should point to the location of php_oracle.dll etc.
I think there is something about the distribution of php from php.net that
doesn't enable oracle properly. Try downloading it from
http://php.weblogs.com/easywindows.
The following post (from this list) may help with your next problem! ie
Net80/SqlNet. It also helps to install at least the client software for
Oracle 8.1.6. I have successfully connected to a 7.3.4 database using
ora_logon, but haven't tried ocilogon, as I think this is intended for v8.
From: Leon Santos Filho [mailto:leon@rosch.com.br]
Sent: 13 March 2001 16:15
To: Herbert Groot Jebbink; php-windows@lists.php.net
Subject: Re: [PHP-WIN] Can't connect to Oracle
Hi!
I get this code here and it works very well. It was a Jean-Christophe
suggestion.
You can obtain TNS string from file TNSNAMES.ORA.
Good Luck!
Leon
<?php
putenv("ORACLE_SID=badm");
putenv("ORACLE_HOME=D:\ORANT");
$tns = "(DESCRIPTION = (ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST =
bhz_oracle_1)(PORT = 1521))) (CONNECT_DATA = (SID = badm) ) )";
$connect=OCIPLogon("user","password",$tns) or die("It's not possible
to
connect");
$sql = "select * from CentrosCusto";
$result = OCIParse($connect,$sql);
OCIExecute($result) or die("It's not possible to query");
echo("<TABLE>");
while(OCIFetch($result)) {
$CC = OCIResult($result,1);
$CCNome = OCIResult($result,2);
echo('<TR><TD>' . $CC . '</TD><TD>' . $CCNome .
'</TD></TR>');
}
echo("</TABLE>");
Euan Greig
Technical Consultant
BRANN DATA
euan.greig@brann.com
01285 645997
**************************************************************************
Any opinions expressed in this email are those of the individual and
not necessarily the Company. This email and any files transmitted with
it, including replies and forwarded copies (which may contain alterations)
subsequently transmitted from the Company, are confidential and solely for
the use of the intended recipient. If you are not the intended recipient
or the person responsible for delivering to the intended recipient, be
advised that you have received this email in error and that any use is
strictly prohibited.
**************************************************************************
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net