#23131 [NEW]: If fsockopen can't open connection, if(!fp) doesn't run

From: Date: Wed, 09 Apr 2003 14:01:42 +0000
Subject: #23131 [NEW]: If fsockopen can't open connection, if(!fp) doesn't run
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-37436@lists.php.net to get a copy of this message
From: kangstarr at hotmail dot com Operating system: Windows XP PHP version: 4.3.1 PHP Bug Type: Sockets related Bug description: If fsockopen can't open connection, if(!fp) doesn't run $fp = fsockopen("kang.kicks-ass.net", "8000", &$errno, &$errstr, 20); //open connection if(!$fp) { echo "No Connection"; $success=2; //set if no connection } Basically I'm checking to see if my SHOUTcast server is running. If the shoutcast server is not running, and it tries to open the connection I get these html warnings. Warning: fsockopen() [function.fsockopen]: php_hostconnect: connect failed in e:\inetpub\wwwroot\scast\scastxml.php on line 37 Warning: fsockopen() [function.fsockopen]: unable to connect to kang.kicks-ass.net:8000 in e:\inetpub\wwwroot\scast\scastxml.php on line 37 Fatal error: Maximum execution time of 30 seconds exceeded in e:\inetpub\wwwroot\scast\scastxml.php on line 37 I'm running WinXP, Apache 1.3, PHP 4.3.1 -- Edit bug report at http://bugs.php.net/?id=23131&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=23131&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=23131&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=23131&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=23131&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=23131&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=23131&r=support Expected behavior: http://bugs.php.net/fix.php?id=23131&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=23131&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=23131&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=23131&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23131&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=23131&r=dst IIS Stability: http://bugs.php.net/fix.php?id=23131&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=23131&r=gnused

« previous php.bugs (#37436) next »