duannian4784 2015-01-27 08:44
浏览 115

PHP Oracle:oci_connect不显示错误

There is an error in the oci_connect line. But my problem is that the error doesn't show in the page. Even if I put $e = oci_error(); it will not be executed anymore to show the error. I tried try/catch but it didn't work either.

When I change the connection details to connect to another database it works. The connection details I use do work in SQL Developer.

$db='(DESCRIPTION =
(ADDRESS_LIST =
  (ADDRESS = (PROTOCOL = TCP)(HOST = '. $GLOBALS['HOST']. ')(PORT = '. $GLOBALS['PORT'] .'))
)
(CONNECT_DATA =
  (SID = '. $GLOBALS['SID'] . ')
)
)';
echo '<br>USERNAME: *'. $GLOBALS['USERNAME'] .'*';
echo '<br>PASSWORD: *'. $GLOBALS['PASSWORD'] .'*';
echo '<br>2 db: *'. $db .'*';
$conn = oci_connect($GLOBALS['USERNAME'], $GLOBALS['PASSWORD'], "$db");
echo 'success';
die;
  • 写回答

1条回答 默认 最新

  • doudong1117 2015-01-27 09:52
    关注

    There are really no errors being shown after trying changing the PHP.ini file setting to show all errors, then I have updated the Oracle Instant Client version.

    First I check what Oracle version I'm using:

    select * from v$version
    where banner like 'Oracle%';
    

    Output:

    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    

    After this I downloaded new Oracle Instant Client version Version 11.2.0.3.0 and set it to PATH and restarted server. Then it worked!

    评论

报告相同问题?

悬赏问题

  • ¥15 Python输入字符串转化为列表排序具体见图,严格按照输入
  • ¥20 XP系统在重新启动后进不去桌面,一直黑屏。
  • ¥15 opencv图像处理,需要四个处理结果图
  • ¥15 无线移动边缘计算系统中的系统模型
  • ¥15 深度学习中的画图问题
  • ¥15 java报错:使用mybatis plus查询一个只返回一条数据的sql,却报错返回了1000多条
  • ¥15 Python报错怎么解决
  • ¥15 simulink如何调用DLL文件
  • ¥15 关于用pyqt6的项目开发该怎么把前段后端和业务层分离
  • ¥30 线性代数的问题,我真的忘了线代的知识了