How to timing process in php for request Timeout

As I stated in my answer here, this particular error message is generated by the LiteSpeed web server (a faster replacement for Apache). It has a special feature whereby it cancels long-running scripts (even those that use set_time_limit()). To disable this, you need to put the following in your .htaccess file in the root of your site.

RewriteEngine On
RewriteRule .* - [E=noabort:1]
RewriteRule .* - [E=noconntimeout:1]

You can set set_time_limit to bigger value than default 30s. But from your code, I don't see why it must make timeout. Maybe some configuration issues? Like mysql is taking too long to connect?

Also, don't use deprecated mysql_* functions. Use mysqli_* or PDO.

Tags:

Php