Home > php教程 > php手册 > PHP连接Oracle ORA

PHP连接Oracle ORA

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 19:51:12
Original
1001 people have browsed it

错误提示:ocilogon(): ORA-12154: TNS:could not resolve the connect identifier specifie! 操作系统:Win7 本地环境:xampp-win32-1.8.2-1-VC9 、 Oracle 10g。 PHP连接测试代码: [php] ocilogon('emesc','emesc','mesb'); //print_r(oci_error()); ocil

  错误提示:ocilogon(): ORA-12154: TNS:could not resolve the connect identifier specifie!

  操作系统:Win7

  本地环境:xampp-win32-1.8.2-1-VC9 、 Oracle 10g。

  PHP连接测试代码:

  [php]

  ocilogon('emesc','emesc','mesb');

  //print_r(oci_error());

  >

  ocilogon('emesc','emesc','mesb');

  //print_r(oci_error());

  >结果发现提示:ocilogon(): ORA-12154: TNS:could not resolve the connect identifier specifie!

  原因分析:之前通过自己配置tnsnames.ora和环境变量来使用PL/SQL,导致安装oracle客户端的时候环境变量异常。导致PHP无法解析连接字符串。

  解决方案:在系统中添加:名为TNS_ADMIN的环境变量:D:\oracle\product\10.2.0\db_1\network\ADMIN。测试连接成功!

PHP连接Oracle ORA

Related labels:
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template