当前位置:首页 > 数据库 > Oracle

PHP连接OracleORA-121154问题解决_PHP教程

错误提示: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:oracleproduct10.2.0db_1networkADMIN。测试连接成功!

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/477170.htmlTechArticle错误提示:ocilogon(): ORA-12154: TNS:could not resolve the connect identifier specifie! 操作系统:Win7 本地环境:xampp-win32-1.8.2-1-VC9 、 Oracle 10g。 PHP连接测...


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!

相关教程推荐

其他课程推荐