duanlu0559 2012-02-09 17:45
浏览 29
已采纳

PHP无法连接,但SqlPlus可以

Here is an issue that is boggling my cells right now.

There is an oracle server that I want to connect to. I can easily connect to it using the sqlplus command line.

When I try to connect to the oracle database with PHP though, it fails. Here is the catch, we have the same setup in another datacenter; a PHP machine is trying to connect to an oracle database. I've run the exact same code, configured php identically on both PHP machines.

PHP1 can connect to Oracle1 with both sqlplus and through php.

PHP2 connects to Oracle2 with sqlplus but NOT with PHP.

There are firewalls and some port blocking going on. My current explanation is that the port php2 is using to connect to oracle2 is not the default 1521 and it is being blocked.

The ora error I get is :

ORA-06413 : Connection not open.

Any ideas?

  • 写回答

2条回答 默认 最新

  • dongyu9894 2012-02-10 08:47
    关注

    The error indicates that the TNS connect descriptor can't be parsed for one reason or another. It's usually a problem with a system call made by Oracle when it's attempting to build connection information.

    Are there any brackets in your program name, username, or machine name?

    Are you running a 32-bit Oracle client on a 64-bit Windows OS by any chance?

    Try using the tnsping utility from the command line. What does that tell you?

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥50 三种调度算法报错 有实例
  • ¥15 关于#python#的问题,请各位专家解答!
  • ¥200 询问:python实现大地主题正反算的程序设计,有偿
  • ¥15 smptlib使用465端口发送邮件失败
  • ¥200 总是报错,能帮助用python实现程序实现高斯正反算吗?有偿
  • ¥15 对于squad数据集的基于bert模型的微调
  • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
  • ¥20 steam下载游戏占用内存
  • ¥15 CST保存项目时失败
  • ¥20 java在应用程序里获取不到扬声器设备