Code:
PHP Warning: fsockopen() [function.fsockopen]: unable to connect to xx.xx.xx.xx:3306 (Connection timed out) in /home/...
I'm trying to catch or silence an error message when the fsockopen() function times out. In the code below I've added my trigger_error() function which in other cases does my error reporting but with fsockopen() I get both the php warning plus my custom error message

Code PHP:
$fp = @fsockopen($serverinfo["ip"], $serviceinfo["port"], &$errno, &$errstr, 4);
if (!$fp)
{    trigger_error("Socket error", E_USER_ERROR);

The error log shows

56: the warning issued by php
57: my trigger_error() message
58: This is interesting! fsockopen() seems to have destroyed the $_SERVER array, at least the $_SERVER['SERVER_NAME'] cell!

Code:
56 [13-Feb-2013 15:40:05] PHP Warning: fsockopen() [function.fsockopen]: unable to connect to xx.xx.xx.xx:26 (Connection timed out) in /home/.../upstat.php on line 66 

57 [13-Feb-2013 15:40:05] PHP Fatal error: Socket error in /home/.../upstat.php on line 68 

58 [13-Feb-2013 15:40:05] PHP Notice: Undefined index: SERVER_NAME in /home/.../phpErrorReporter.php on line 213
The fsockopen() timeout warning is really cluttering up my error log and I'd like to suppress it. Can it be done? Note the "@" is already in place.