简体   繁体   English

fsockopen无法正常使用FastCGI(PHP)

[英]fsockopen not working whit FastCGI (PHP)

I have a php question about fsockopen 我有关于fsockopen的php问题

Server: 服务器:

VPS CentOS 6.3 (Final) PLESK 11 VPS CentOS 6.3(最终)PLESK 11

Problem: 问题:

If i use FastCGI the function fsockopen is not working. 如果我使用FastCGI函数fsockopen不起作用。 I get: Warning: fsockopen(): unable to connect to xx.xx.xx.xx:80 (Permission denied) 我得到:警告:fsockopen():无法连接到xx.xx.xx.xx:80(权限被拒绝)

If i edit the website (for testing) in plesk 11 and set it to apache it works. 如果我在plesk 11中编辑网站(用于测试)并将其设置为apache,则可以正常工作。

I can't find the fix for this problem. 我找不到解决这个问题的方法。 Somebody has a clue? 有人有线索吗?

Disable selinux or add a new rule to let apache open remote connections 禁用selinux或添加新规则以让apache打开远程连接

to add a rule use 添加规则使用

setsebool -P httpd_can_network_connect 1

to disable selinux or set it in permissive mode edit your 禁用selinux或将其设置为许可模式编辑你的

/etc/selinux/config

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM