Query timeout support has been implemented in PHP. The query timeout can be set in php.ini by setting the ctsql.querytimeout property to the number of seconds. The default is 0 meaning no timeout.
For example, to set a 5-second timeout:
[ctsql]
ctsql.querytimeout=5