There are certain posts on MySQL connection set time out from PHP using mysql.connect_timeout. I want to know if this set timeout from PHP just time out the initial connecti
sigalarm is your friend. You can set a alarm, and use a signal handler to detect the alarm.
http://php.net/manual/en/function.pcntl-alarm.php