Increasing Execution Time Limit in PHP | andi setiawan's blog

have you ever wondering how fetch a huge number of applications and games across the internet by using only one PHP script? Well, I will tell you the secret in next paragraph. But, first, please visit and download something there, or just browse the apps to know better.

Loading Huge APK Database in one shot

Well, the main secret of the script is one of PHP function, simplexml_load_file(). The function will fetch an XML from repo specified and extract the data to the database. Got it? if you don’t, then read the manual first!

But the problem is, I got numbers of android repos and one repo could contain hundreds even thousands of application. that’s mean 2000-4000 APKs should be fetched in one shot.

In the early version of, I could spend 5 to 10 minutes just to re-fetch APK database. But not anymore.

To the point, I use the set_time_limit() function to let my PHP script run more than 30 seconds. So my scripts has a chance to fetch more APK database in just one shot.  I use this function too when I have to fetch the size of the APK, so thousands of HTTP request sent by a single PHP script.

Usage: set_time_limit (3600); // this set the timout limit to one hour (3600 seconds)

Be sure to put this function on top of the script.

But, beside that, you have to adjust your browser setting too. I use Mozilla Firefox, the setting is easy. Just type “about:config” in the address bar, then search for “timeout”, you can set the value to 3600 (one hour).

Have a nice try.

Posted in php, programming, Tips n Trik | Tagged |

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: