Oracle TNS权限被拒绝* [英] Oracle TNS Permission Denied *
问题描述
我正在使用:
- CentOS 6.7
- 使用oci8的Zend.1.2.15,使用Instantclient 11.2 x64
- PHP 5.4.45
尝试连接到Oracle:
- Oracle数据库10g版本10.2.0.4.0
已经检查过凭据,已经尝试连接到其他Oracle服务器,但是错误仍然相同:
12546 ORA-12546:TNS:权限被拒绝*
在回答了一些问题后,已经授予了/usr/local/oracle/11.2/client64/
的0777权限,但没有一个得到解决.
服务器没有任何黑名单中的IP.
相同的代码在具有OracleInstantClient的任何其他Windows PC上运行,并且不需要在服务器上进行任何有关授予IP访问权限或任何权限的配置.
我还有更多可以检查的方法来解决此问题吗?
经过数小时的搜索,我发现了这篇文章: https://wiki.centos.org/TipsAndTricks/SelinuxBooleans
总体信息: https://wiki.centos.org/HowTos/SELinux >
I'm using:
- CentOS 6.7
- Zend.1.2.15 using oci8, using instantclient 11.2 x64
- PHP 5.4.45
Trying to connect to an Oracle:
- Oracle Database 10g Release 10.2.0.4.0
Already checked credentials, already tried to connet to other Oracle server but the error still the same:
12546 ORA-12546: TNS:permission denied *
Already gave 0777 permission to /usr/local/oracle/11.2/client64/
following some answer around but none of them solved.
Server does not have the IP in any sort of blacklist.
The same code runs in any other Windows PC with OracleInstantClient and no further configuration was needed on the server about giving an IP permissions to access or any permission at all.
Is there something more that I can check to solve this?
After hours searching I found this article: http://www.emsperformance.net/2013/12/20/connecting-to-oracle-database-from-php-with-oci8/ which is by far the best article explaining the installation process of LAMP, Oracle, Zend.
The setting I was missing is:
setsebool -P httpd_can_network_connect on
Edit: After a while this answer still looks useful to someone, worths to say that this happens because the machine has SELinux activated, usually in the enforcing
mode. I would not recommend to disable SELinux, but setting it to permissive
looks to ease the process of identifying some problems with it. You can check SELinux status by sestatus
.
A full list of booleans on SELinux is available at: https://wiki.centos.org/TipsAndTricks/SelinuxBooleans
Overall information: https://wiki.centos.org/HowTos/SELinux
这篇关于Oracle TNS权限被拒绝*的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!