php ORA-24408: 无法生成唯一的服务器组名

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10484231/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-24 22:17:40  来源:igfitidea点击:

ORA-24408: could not generate unique server group name

phporacle

提问by Subdigger

system:

系统:

Linux web 2.6.27.21-0.1-pae #1 SMP 2009-03-31 14:50:44 +0200 i686 i686 i386 GNU/Linux

PHP Version 5.3.8
Apache Version  Apache/2.2.21 (Linux/SUSE)
OCI8 Support    enabled
Version     1.4.7
Revision    $Revision: 321634 $
Active Persistent Connections   0
Active Connections  0
Oracle Run-time Client Library Version  11.2.0.3.0
Oracle Instant Client Version   11.2

when calling oci_connect- receiv

打电话时oci_connect- 接收

ORA-24408: could not generate unique server group name

ORA-24408: 无法生成唯一的服务器组名

can`t understand what the kind error is this and howto fix it.

无法理解这是什么类型的错误以及如何修复它。

采纳答案by Sérgio Michels

This is a error with compatibility of the runtime oracle 11g and PHP Oci support. As the OP confirm, the downgrade of the client to 10g works. The solution was found here.

这是运行时 oracle 11g 和 PHP Oci 支持兼容性的错误。正如 OP 所确认的,将客户端降级到 10g 是可行的。解决方案在这里找到。

回答by Camden S.

You can downgrade to 10g if you want (it evidently doesn't care about this) but that's not necessary...

如果你愿意,你可以降级到 10g(它显然不关心这个)但这不是必需的......

The 11g instant client requires a /etc/hostsfile entry for your hostname pointing to 127.0.0.1. The normal "localhost" entry is not sufficient on it's own.

11g 即时客户端需要/etc/hosts您的主机名的文件条目指向 127.0.0.1。普通的“localhost”条目本身是不够的。

Assuming your host name is foomachine, there are two places you'll need to check:

假设您的主机名是foomachine,您需要检查两个地方:

In /etc/hosts, make sure you have any entry like - add it if it's not there:

在 中/etc/hosts,确保您有任何条目,如 - 如果不存在,请添加:

127.0.0.1   foomachine

And also make sure the /etc/sysconfig/networkfile also has HOSTNAME=foomachine

并确保该/etc/sysconfig/network文件也有HOSTNAME=foomachine

That should do the trick.

这应该够了吧。

回答by Rosina Bignall

Kind of an old question, but I just stumbled on it after upgrading my Mac to Sierra. Until then I hadn't had the problem.

有点老问题,但我只是在将 Mac 升级到 Sierra 后偶然发现了它。在那之前我还没有遇到过这个问题。

The trick is definitely to add your hostname to /etc/hosts, but you have to have the right hostname. That's easy on linux, it's in /etc/sysconfig/network. On Mac find it in System Preferences > Sharing. Under where it says Computer name will be something like computer-name.local. In /etc/hosts put

诀窍肯定是将您的主机名添加到 /etc/hosts,但您必须拥有正确的主机名。这在 linux 上很容易,它在 /etc/sysconfig/network 中。在 Mac 上,在“系统偏好设置”>“共享”中找到它。在它所说的计算机名称下,将类似于计算机名称.local。在 /etc/hosts 中放入

   127.0.0.1 computer-name.local

Replacing computer-name with your computer name of course :). It needs this regardless of whether the database is a remote one or a local one.

当然,用您的计算机名称替换计算机名称:)。 无论数据库是远程数据库还是本地数据库,它都需要这一点。

I had plenty of other aliases for 127.0.0.1 but not that one. As soon as I added that one my apps started working again.

我有很多其他的 127.0.0.1 别名,但不是那个。一旦我添加了那个,我的应用程序又开始工作了。

回答by StampyCode

In my situation, the OracleDB server I was trying to connect to was a remote one, not a local one, so the above 127.0.0.1 localhosttrick didn't work.

在我的情况下,我尝试连接的 OracleDB 服务器是远程服务器,而不是本地服务器,因此上述127.0.0.1 localhost技巧不起作用。

Previously, I had temporarily fixed a DNS problem by adding an entry for my Oracle DB server into my hosts file. This IP in my hosts file was still correct- it still pointed to the correct OracleDB server IP.

以前,我通过将 Oracle 数据库服务器的条目添加到我的主机文件中来临时解决 DNS 问题。我的主机文件中的这个 IP仍然是正确的- 它仍然指向正确的 OracleDB 服务器 IP。

By removing the entry from my hosts file, the problem went away.

通过从我的主机文件中删除条目,问题就消失了。

I have no idea why this is a problem for OracleDB, or why the error message is so obtuse, but I hope this helps someone else.

我不知道为什么这是 OracleDB 的问题,或者为什么错误消息如此迟钝,但我希望这对其他人有所帮助。

(This was using InstantClient v12.1.0.2 on MacOS v10.11.5)

(这是在 MacOS v10.11.5 上使用 InstantClient v12.1.0.2)

回答by Alice Vixie

You actually do not needto go with 127.0.0.1in /etc/hostswith something like

实际上,你并不需要与走127.0.0.1/etc/hosts喜欢的东西

echo -e "127.0.0.1\t$HOSTNAME" >> /etc/hosts

which is against common sense (and formally against RFC 6761only from February 2013 ).

这是违反常识的(并且仅从 2013 年 2 月才正式反对RFC 6761)。

Luckily it will also work if you only have your real IP address registered - something like

幸运的是,如果您只注册了您的真实 IP 地址,它也可以工作——比如

192.0.2.5 mymachine.example.net

which is btw frequently missing in virtual machines created with DHCP.

顺便说一句,在使用 DHCP 创建的虚拟机中经常缺少。

or - the last resort scenario - use some other IP address from 127.0.0.0/8

或者 - 最后的方案 - 使用来自 127.0.0.0/8 的其他 IP 地址

127.0.1.1 mymachine.example.net

Tested with Oracle Instant Client 11.2.

使用Oracle Instant Client 11.2 进行测试。

Sysadmins dealing with weird stuff like Legato Backup will thank you for not messing with /etc/hosts.

处理诸如 Legato Backup 之类的奇怪东西的系统管理员会感谢您没有弄乱/etc/hosts.

回答by Dorjee Dhondup

Adding this to /etc/hosts resolved the issue.

将此添加到 /etc/hosts 解决了该问题。

127.0.0.1 someHostName

To find your computer's host name, just type hostname in Terminal. Use a text editor such as vim to edit hosts.

要查找计算机的主机名,只需在终端中输入主机名。使用 vim 等文本编辑器编辑主机。

~ hostname
someHostName
~ cd /etc
/etc sudo vim hosts

回答by gpayne_007

I had exactly the same problem. I fixed my /etc/hosts and /etc/sysconfig/network file and RESTARTED THE NETWORK and it works fine now. Here are some quick and dirty instructions:

我遇到了完全相同的问题。我修复了我的 /etc/hosts 和 /etc/sysconfig/network 文件并重新启动网络,现在它工作正常。以下是一些快速而肮脏的说明:

http://ahmadzainuddinzakaria.blogspot.com/2012/06/warning-ociconnect-functionoci-connect.html

http://ahmadzainuddinzakaria.blogspot.com/2012/06/warning-ociconnect-functionoci-connect.html

回答by Janderson Silva

In CentOS 6.5 I changed the value of the file: /etc/sysconfig/network

在 CentOS 6.5 中,我更改了文件的值: /etc/sysconfig/network

Original value:

原始值:

HOSTNAME=localhost.localdomain

New value:

新值:

HOSTNAME=127.0.0.1