I have added set_time_limit(0);
function to increase execution time but its executing only 2-3 minutes maximum.
error_reporting(E_ALL); error_reporting(1); set_time_limit(0);
I want to search links from a site which is taking a long time.
Log in to cPanel using your credentials. Navigate to the Software section and click on the MultiPHP INI Editor. In the new window, select your domain from the dropdown menu, locate the max_execution_time PHP directive, and change the value associated with it to 300.
PHP file (for example, my_lengthy_script.php)
ini_set('max_execution_time', 300); //300 seconds = 5 minutes
.htaccess file
<IfModule mod_php5.c> php_value max_execution_time 300 </IfModule>
More configuration options
<IfModule mod_php5.c> php_value post_max_size 5M php_value upload_max_filesize 5M php_value memory_limit 128M php_value max_execution_time 300 php_value max_input_time 300 php_value session.gc_maxlifetime 1200 </IfModule>
If wordpress, set this in the config.php file,
define('WP_MEMORY_LIMIT', '128M');
If drupal, sites/default/settings.php
ini_set('memory_limit', '128M');
If you are using other frameworks,
ini_set('memory_limit', '128M');
You can increase memory as gigabyte.
ini_set('memory_limit', '3G'); // 3 Gigabytes
259200 means:-
( 259200/(60x60 minutes) ) / 24 hours ===> 3 Days
More details on my blog
Add these lines of code in your htaccess file. I hope it will solve your problem.
<IfModule mod_php5.c> php_value max_execution_time 259200 </IfModule>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With