filip212

Member
Aug 22, 2017
19
1
3
Slovakia
cPanel Access Level
Root Administrator
Hello,
I have problem with use php function fwrite().
I have php server status script which use fsocket fwrite and some other functions.
Installed CMS is php-fusion.
All servers shows offline but when i disable firewall servers show Online.
I have CSF firewall how i can configure it to all users will be able have server status script on their webpages please?
Error is: fwrite(): send of 25 bytes failed with errno=1 Operation is not allowed Line: 342

Line 342:
fwrite($live_server, $packet);
343 socket_set_timeout($live_server,1,0);
344 $junk = fread($live_server,5);
345 $status = socket_get_status($live_server);
346 $do = 1;
347 $server_info= "";
348
349 while($do)
350 {
351 $str_1 = fread($live_server,1);
352
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
All servers shows offline but when i disable firewall servers show Online.
I have CSF firewall how i can configure it to all users will be able have server status script on their webpages please?
Hello,

You may need to allow outgoing connections over port 80 from the server's local IP address (127.0.0.1) for this to work.

Thank you.
 

filip212

Member
Aug 22, 2017
19
1
3
Slovakia
cPanel Access Level
Root Administrator
I added this:
tcp|out|s=80|s=127.0.0.1
udp|out|s=80|s=127.0.0.1

To csf.allow and restarted firewall but it still doesnt work
This is example of servers ip which websites try get server status:
82.208.17.175:27022
82.208.17.102:27433
But port can be on that gameservers any...
 

filip212

Member
Aug 22, 2017
19
1
3
Slovakia
cPanel Access Level
Root Administrator
I solved it with open UDP port 27433 but i need open more ports. I need open range 27000-28000 and 25565-25600 is it safe? I think when is it outbound connections no security risk is there but if is can you explain please?