PHP无法连接,但是SqlPlus可以 [英] PHP can't connect, but SqlPlus can

查看:64
本文介绍了PHP无法连接,但是SqlPlus可以的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个使我的单元格陷入困境的问题.

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

有一个我想连接的Oracle服务器.我可以使用sqlplus命令行轻松连接到它.

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

但是,当我尝试使用PHP连接到oracle数据库时,它失败了.这很重要,我们在另一个数据中心具有相同的设置; PHP机器尝试连接到oracle数据库.我已经运行了完全相同的代码,在两台PHP机器上都配置了相同的php.

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既可以使用sqlplus也可以通过php连接到Oracle1.

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

PHP2使用sqlplus连接到Oracle2,但是不使用PHP.

PHP2 connects to Oracle2 with sqlplus but NOT with PHP.

有防火墙和一些端口阻塞正在进行.我目前的解释是,php2用于连接到oracle2的端口不是默认的1521,并且已被阻止.

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.

我收到的ora错误是:

The ora error I get is :

ORA-06413:连接未打开.

ORA-06413 : Connection not open.

有什么想法吗?

推荐答案

该错误表明TNS连接描述符由于某种原因而无法解析.在尝试建立连接信息时,Oracle进行系统调用通常是一个问题.

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?

您是否有机会在64位Windows操作系统上运行32位Oracle客户端?

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

尝试从命令行使用tnsping实用程序.这告诉你什么?

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

这篇关于PHP无法连接,但是SqlPlus可以的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆