title: Cant get php script to ping specific port and IP
body: <p>I have been trying to ping a specific IP and port to check if it online or offline. If I set the port to 80, it works but any other port it says it not working. I am able to connect to the port via game, telnet, etc</p>
  
  <pre><code>//Connection Info
  $ip = "*******"; //IP
  $port = "2302"; //Port
  
  //Connection
  $sock = @fsockopen( $ip, $port, $num, $error, 2 ); //2 is the ping time, you can sub what you need
  
  //Check Status
  
  if( !$sock ){
  
  //Closed
          echo( "It appears to be closed" );
  
  }
  
  if( $sock ){
  
  //Open
          echo( "It appears to be open" );
          fclose($sock);
  
  }
  </code></pre>
  
  <p>Here is the error I get</p>
  
  <pre><code>Warning: fsockopen() [function.fsockopen]: unable to connect to *******:2302 (No connection could be made because the target machine actively refused it. )
  </code></pre>