too long

I am trying to make a server status page for my game server and the code ends up not showing if the server is online.

<?PHP 
$ts_ip = "177.82.148.141"; 
$ts_port = "2505"; 

$output = @fsockopen("$ts_ip", $ts_port, $errno, $errstr, 2);  
stream_set_timeout($output, 00002);

if (!$output) { 
    echo "<FONT COLOR=#DD0000><B>FEB Offline</B></FONT>"; 
} else { 
    echo "<FONT COLOR=#00DD00><B>FEB Online</B></FONT>"; 
} 
@fclose($output); 
?>

It also gives me this error:

Warning: stream_set_timeout() expects parameter 1 to be resource, boolean given in /home/u918484727/public_html/teste.php on line 6

May someone help me?

There's probably a better way to handle this but this will make it work.

$ts_ip = "177.82.148.141"; 
$ts_port = "2505"; 

$output = @fsockopen($ts_ip, $ts_port, $errno, $errstr, 2); 

if (!$output) { 
    echo "<FONT COLOR=#DD0000><B>FEB Offline</B></FONT>"; 
} else { 
    echo "<FONT COLOR=#00DD00><B>FEB Online</B></FONT>";  
    stream_set_timeout($output, 00002);
    @fclose($output); 
} 

I put $output logic in the else so that your code doesn't attempt to use it as a resource when it returns false.

Also, although it isn't the cause of the problem, as supajason pointed out you should probably use $ts_ip instead of "$ts_ip". You should also refactor your code in other ways, such as removing the @ error suppression.

"$ts_ip" shouldn't have " round them?