Oracle TNS Permission Denied *

ε祈祈猫儿з 提交于 2021-02-08 14:41:26

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/32592508/oracle-tns-permission-denied

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!