Re: PHP4/Apache on Win95 to remote Oracle

From: Date: Fri, 09 Feb 2001 16:28:30 +0000
Subject: Re: PHP4/Apache on Win95 to remote Oracle
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-6512@lists.php.net to get a copy of this message
Mark, > Go to bugs.php.net and search thru the open bugs for "oracle" You'll find > a good dozen bugs on Windows that seem to be describing this problem. > #6396 and #8132 come to mind. In addition, bug #7446 for standard Oracle Later, Jorge santos@net-lynx.com ----- Original Message ----- From: Mark Farver <farver@texas.net> To: Jorge Santos <santos@net-lynx.com> Cc: Mark Farver <farver@texas.net> Sent: Friday, February 09, 2001 9:55 AM Subject: Re: [PHP-DB] PHP4/Apache on Win95 to remote Oracle > On Thu, 8 Feb 2001, Jorge Santos wrote: > > > This isn't good news.... I'll let you know what I find out. If what you > > stated is true, then where's the BUG list... > > Go to bugs.php.net and search thru the open bugs for "oracle" You'll find > a good dozen bugs on Windows that seem to be describing this problem. > #6396 and #8132 come to mind. > > Mark > > > > > Thanks for the info. > > Later, > > Jorge > > santos@net-lynx.com > > ----- Original Message ----- > > From: Mark Farver <farver@texas.net> > > To: Jorge Santos <santos@net-lynx.com> > > Cc: PHP-DB <php-db@lists.php.net> > > Sent: Thursday, February 08, 2001 5:39 PM > > Subject: Re: [PHP-DB] PHP4/Apache on Win95 to remote Oracle > > > > > > > > Please help. I'm going maaddd trying to figure this out. I've pretty > > much > > > > read all of the online docs and spend countless hours reading through > > the > > > > archives.. > > > > > > > > I'm running PHP4 and Apache on my Win95 computer. > > > > I'm trying to connect to a remote Oracle database. > > > > > > I had the same problem last week. Every suggestion I got was about > > > environment variables. However since a tnsping from within PHP > > > (using passthru) works fine I know better. From examining the sqlnet > > > files and watching the resource allocations I came to the conclusion that > > > PHP is hardcoded to connect only to a database located on the same > > > machine (using BEQLOCAL). Oracle never even bothers to read the > > > tnsnames.ora file when its called from PHP. This seems to be only a > > > problem in Windows and possibly only with the Oracle8 drivers. > > > > > > My postings to the dev lists went unanswered but at the time I was unsure > > > if it was a Windows only problem. It might be worth reposting this info > > > to the PHP-WIN list. > > > > > > My boss was very unhappy when I told him my code had to run on a Unix > > > box.. I basically sold him on PHP due to is cross-paltform nature. > > > > > > ODBC might work instead, although it never did for me. Use ADODB or > > > another abstraction layer.. this way you can switch back and forth easier. > > > > > > Let me know if you figure anything else out. > > > > > > Mark Farver > > > mfarver@mindbent.org > > > > > > On Thu, 8 Feb 2001, Jorge Santos wrote: > > > > > > > Hi all, > > > > > > > > > > > > I'm getting a "Warning: _oci_open_server: ORA-12203: TNS:unable to > > connect to destination ..." error message. Yet I know the environment is ok > > because I can tnsping the database name and I can connect using SQL Plus to > > the database. > > > > > > > > Here's the php code: > > > > > > > > <?php > > > > putenv("ORACLE_SID=MDC6"); > > > > putenv("ORACLE_HOME=D:\PROGRA~1\ORAWIN95"); > > > > putenv("TNS_ADMIN=D:\PROGRA~1\ORAWIN95\NET80\ADMIN"); > > > > > > > > $tns = "(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL =TCP)(HOST > > = njnwkora15.db.pseg.com)(PORT = 1527))) (CONNECT_DATA = (SID =MDC6) ) )"; > > > > > > > > $connect=OCIPLogon("MDC","MDC",$tns) or die("It's > > > > not possible to > > connect"); > > > > > > > > $sql = "select * from district"; > > > > > > > > $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>"); > > > > ?> > > > > > > > > I shouldn't need to declase $tns above but I've tried with and without > > it. I'm also including the ORACLE_SID, ORACLE_HOME and TNS_ADMIN variables > > in the autoexec.bat so that they are declared as of machine bootup. I also > > added them to the httpd.conf for Apache configuration like this: > > > > > > > > SetEnv ORACLE_SID MDC6 > > > > SetEnv ORACLE_HOME D:\PROGRA~1\ORAWIN95 > > > > SetEnv TNS_ADMIN D:\PROGRA~1\ORAWIN95\NET80\ADMIN > > > > > > > > > > > > Please help.... Before I switch to ASP... > > > > Later, > > > > Jorge > > > > santos@net-lynx.com > > > > > > > > > > -- > > > "The greatest dangers to liberty lurk in insidious enroachment by mean of > > > zeal, well-meaning but without understanding." > > > -- Justice Louis O. Brandeis, Olmstead vs. United States > > > > > > > > > -- > "The greatest dangers to liberty lurk in insidious enroachment by mean of > zeal, well-meaning but without understanding." > -- Justice Louis O. Brandeis, Olmstead vs. United States >

« previous php.db (#6512) next »