[SOLVED] Re: PHP+Oracle: could not resolve service name

From: Álvaro G. Vicario <alvaroNOSPAMTHANKS_at_demogracia.com>
Date: Thu, 10 Apr 2008 19:05:27 +0200
Message-ID: <ftlhco$fkr$1@huron.algomas.org>

Álvaro G. Vicario escribió:
> My issue is that PHP scripts cannot connect to the database server when I
> run them from the *command line*. I get this error message:
> SQL error: [Microsoft][ODBC driver for Oracle][Oracle]ORA-12154: TNS:no
> se ha podido resolver el nombre del servicio, SQL state 08001 in SQLConnect
> Which translates into English as "could not resolve service name".
> The *very same code* runs fine when parsed through the web server (Apache2 +
> PHP module running as LocalSystem) and I've found no problems using TOAD.
> Apart from environment, PHP configuration is identical in command line and
> web.

Oh my... I've fixed it. I had to strip Windows line feeds out of "TNSNAMES.ORA" and "SQLNET.ORA" and replace them with Unix ones!


GRMFFF@#$%&....... BTW, is there an easy way to specify my own files for this application? Now it works, I don't want it broken the day any sysadmin edits the file. Received on Thu Apr 10 2008 - 12:05:27 CDT

Original text of this message