![]() Join Up! 96819 members and counting! |
|
|||
php-db | 2001051
Date: 05/09/01
Hi Folks,
Well, thanks to a posting by Benoit Noss on 2001-01-04 I solved my problem.
Benoit's solution was to strip carriarge returns from Tnsnames.ora (remember we are talking Windows/DOS text files here - I would dearly love to change to a Unix box but our web site uses an ActiveX library that isn't available on unix).
Since we use a name server we mainly depend on Sqlnet.ora. I stripped the CR's from Sqlnet.ora by ftp'ing it to a unix host in ascii mode then retrieving it binary mode (didn't have an alternative tool at hand), re-started Apache/CGI and all was well. I tested with php4 as both a module and CGI and everything now works well.
You might like to strip the CR's from Tnsnames.ora as well as most Sqlnet.ora's fall back to Tnsnames.ora if they can't locate the service on an Oracle name server.
I tested, Oci8 connect, odbc connect and ADO. This may be of interest to Unix users having similar problems...many Oracle installs have two copies of Sqlnet.ora and Tnsnames.ora, in my case Oci8 uses the ones under ORACLE_HOME\Net80\Admin\ and odbc connects uses those under ORACLE_HOME\Network\Admin. This may be why stripping CR's from Tnsnames.ora has failed to work for some people.
On our production web server Oci AND odbc uses ORACLE_HOME\Net80\Admin\ but ADO (COM) uses ORACLE_HOME\Network\Admin even though the specified driver is {Oracle ODBC Driver} (go figure).
So a general rule of thumb on Windows servers would be to strip CR's from ALL copies of Sqlnet.ora and Tnsnames.ora. On unix boxes when you set the TNS_ADMIN environment variable before attempting an Orcale connect, ensure that it is pointing to the directory that actually contains Sqlnet.ora/Tnsnames.ora that your oracle client will be using (& make sure ORACLE_HOME is set of course).
I haven't yet figured why without stripping the CR's from the .ora files that oracle connects succeed when php4 is loaded as a module but fails when it is run as CGI...but I have noticed that some environment variables dumped using phpinfo() are different (such as USERPROFILE)...maybe ??? Anyway, haven't got time to delve further now, it can wait until I have some spare time.
Thanks to all, especially Benoit.
Paul Shortis
The following message was sent by "John Edward Molano" <jmolano <email protected>> on Wed, 9 May 2001 15:32:54 -0500.
> Hi
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
|