What are timeouts? Besides a form of punishment for misbehaving kids, time outs are a threshold for scripts. When you set a time out, you basically tell the script that if the execution time of the task exceeds a certain amount, do something; normally, error out. The utilization of time outs are important, especially if you’re connecting to another box for your script.
If the timeout is unlimited by default, when you connect to something that is currently down, or its location changed, that one component of your script might run on indefintely, and it is definitely something you don’t want. Therefore it is wise to put timeouts on any scripts that utilize connections whether it is ftp, mysql, or etc.
There are many ways to set time outs, just to name a few, for PHP, some of the time outs can be set via the php.ini file, the ini_set function, or the class/object’s built in timeout functions. Regardless of form, the utilization of timeouts can be a real headache saver.