Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Oracle Miscellaneous > Re: [SOLVED] Re...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 8 of 9 Topic 6825 of 7279
Post > Topic >>

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

by "Shakespeare" <whatsin@[EMAIL PROTECTED] > Apr 11, 2008 at 07:39 AM

"Ana C. Dent" <anacedent@[EMAIL PROTECTED]
> schreef in bericht 
news:2mBLj.30954$6J3.8137@[EMAIL PROTECTED]
> "Álvaro G. Vicario" <alvaroNOSPAMTHANKS@[EMAIL PROTECTED]
> wrote in
> news:ftlhco$fkr$1@[EMAIL PROTECTED]
>
>> Á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!
>>
>> http://www.phpbuilder.com/lists/php-db/2001051/0192.php
>>
>> GRMFFF@[EMAIL PROTECTED]
>>
>> 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.
>>
>
> Since I don't do Windoze, this may not work for you.
> Under Unix, Oracle will look for .tnsnames.ora (note preceeding dot);
> [a.k.a a hidden file in Unix] located in users $HOME directory &
> use it if the file exists.
>
> Alternatively which does work for both OS is to define environmental
> variable TNS_ADMIN to point to a directory where tnsnames.ora resides.
>
> HTH & YMMV

In Windows, the TNSNAMES.ORA in de working directory (start in..) will be 
used first.

Shakespeare
 




 9 Posts in Topic:
PHP+Oracle: could not resolve service name
"Álvaro G. Vicario&q  2008-04-09 13:35:29 
Re: PHP+Oracle: could not resolve service name
"Shakespeare" &  2008-04-09 21:34:51 
Re: PHP+Oracle: could not resolve service name
Michael Austin <mausti  2008-04-09 16:13:00 
Re: PHP+Oracle: could not resolve service name
joel garry <joel-garry  2008-04-09 14:22:54 
Re: PHP+Oracle: could not resolve service name
=?ISO-8859-1?Q?=22=C1lvar  2008-04-10 12:17:54 
[SOLVED] Re: PHP+Oracle: could not resolve service name
=?ISO-8859-1?Q?=22=C1lvar  2008-04-10 19:05:27 
Re: [SOLVED] Re: PHP+Oracle: could not resolve service name
"Ana C. Dent" &  2008-04-11 03:58:54 
Re: [SOLVED] Re: PHP+Oracle: could not resolve service name
"Shakespeare" &  2008-04-11 07:39:25 
Re: [SOLVED] Re: PHP+Oracle: could not resolve service name
=?ISO-8859-1?Q?=22=C1lvar  2008-04-11 09:11:15 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 20:11:34 CST 2008.