Home > Backend Development > PHP Tutorial > PHP connection to Oracle ORA-121154 problem solving_PHP tutorial

PHP connection to Oracle ORA-121154 problem solving_PHP tutorial

WBOY
Release: 2016-07-15 13:21:39
Original
1478 people have browsed it

Error message: ocilogon(): ORA-12154: TNS:could not resolve the connect identifier specifie!


Operating system: Win7

Local environment: xampp-win32-1.8.2-1-VC9, Oracle 10g.

PHP connection test code:

[php]
ocilogon('emesc','emesc','mesb');
//print_r(oci_error());
?>

ocilogon('emesc','emesc','mesb');
//print_r(oci_error());
?>The result found a prompt: ocilogon(): ORA-12154: TNS:could not resolve the connect identifier specifie!

Cause analysis: I used PL/SQL by configuring tnsnames.ora and environment variables myself, which caused the environment variables to be abnormal when installing the Oracle client. Causes PHP to be unable to parse the connection string.


Solution: Add an environment variable named TNS_ADMIN to the system: D:oracleproduct10.2.0db_1networkADMIN. Test connection successful!

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/477170.htmlTechArticleError message: ocilogon(): ORA-12154: TNS:could not resolve the connect identifier specifie! Operating system: Win7 local environment: xampp-win32-1.8.2-1-VC9, Oracle 10g. PHP connection test...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template