Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fsockopen not working whit FastCGI (PHP)

I have a php question about fsockopen

Server:

VPS CentOS 6.3 (Final) PLESK 11

Problem:

If i use FastCGI the function fsockopen is not working. I get: Warning: fsockopen(): unable to connect to xx.xx.xx.xx:80 (Permission denied)

If i edit the website (for testing) in plesk 11 and set it to apache it works.

I can't find the fix for this problem. Somebody has a clue?

like image 243
Mike Avatar asked Jul 28 '26 02:07

Mike


1 Answers

Disable selinux or add a new rule to let apache open remote connections

to add a rule use

setsebool -P httpd_can_network_connect 1

to disable selinux or set it in permissive mode edit your

/etc/selinux/config
like image 187
Dario Avatar answered Jul 30 '26 17:07

Dario



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!