Change Maximum Execution Time
max_execution_time = 30
Start your code with,
ini_set('MAX_EXECUTION_TIME', 3600);
php_value max_execution_time 3600
No matter which option you choose, restart Apache service.
Dark Quark