我在RHEL5/CentOS专用系统上使用NuSOAP的php应用程序.
我遇到了以下错误:
2010-10-21 06:23:43.374471 soap_transport_http: entered send() with data of length: 1693 2010-10-21 06:23:43.374510 soap_transport_http: connect connection_timeout 0, response_timeout 30, scheme http, host www.mysite.com, port 2194 2010-10-21 06:23:43.374557 soap_transport_http: calling fsockopen with host www.mysite.com connection_timeout 0 2010-10-21 06:23:43.700553 soap_transport_http: Couldn't open socket connection to server http://www.mysite.com:2194/webservice.event, Error (13): Permission denied 2010-10-21 06:23:43.700719 nusoap_client: Error: HTTP Error: Couldn't open socket connection to server http://www.mysite.com:2194/webservice.event, Error (13): Permission denied
我认为它与一些httpd配置有关 - 根据http://www.linuxdevelop.com/redhat--fedora-linux-help/fsockopen-error-13-permission-denied-24366.shtml
我发现问题与SELinux配置有关.
我的服务器上启用了防火墙:策略类型是目标,检查强制当前状态,并且不允许连接到网络的HTTPD脚本.
其中:桌面>系统设置>安全级别> SELinux> httpd>未选中连接到网络的HTTPD脚本.我查了一下它现在正在工作.
但我无法在httpd.conf文件中找到如何直接修改它
setsebool -P httpd_can_network_connect 1
检查这个网址:http://yml.com/fv-b-1-619/selinux--apache-httpd--php-establishing-socket-connections-using-fsockopen---et-al.html