> Frist ,How in script could I Ping?> Second,from command line Ping also hangs.
Don't ping. Let PHP control whether or not it can connect. It willtime out. The problem is you have persistent connections set inyour php.ini file.