I\'ve tried everything to change the max_execution_time
of a php crawler script so that it can run an infinite amount of time.
I have changed the php.in
I found the following in the xampp documentation. Maybe you are trying to edit the wrong php.ini file?
Why have changes in my php.ini no effect?
Since XAMPP 1.7.1 the "php.ini" is only in the directory "\xampp\php". Till XAMPP 1.7.0 is was in the directory "\xampp\apache\bin".
If a change in the "php.ini" have no effect, it's possible PHP is still using an other one. You can verify this with phpinfo(). Go to the URI localhost/xampp/phpinfo.php and search for "Loaded Configuration File". This value shows you the "php.ini" PHP is really using.
Info: After changing the "php.ini" you have to restart Apache, thus Apache/PHP can read the new settings.
use
set_time_limit(0);
at the top of the script
open php.ini notepad file and search or find upload_max_filesize = 1000M
and you should change on Post_max_filesize = 1000M
then restart your xampp and refresh the local phpmyadmin..
what you are doing is just setting the max_execution_time
to whatever inside your page.
you can't change this using ini_set. you can change the memory_limit
only.
see more details here... from the php official site.
if you want them to be changed, change in php.ini.
You shouldn't let your crawler run under apache, it's better to run it stand-alone via cli as part of a Gearman setup.
That way it won't hog your web server and it can run as long as you want. You can find many bindings for Gearman that you can use, including PHP of course.
Try turning off safe mode in php and then try the below code
if( !ini_get('safe_mode') ){
set_time_limit(0); //this won't work if safe_mode is enabled.
}
This should allow you to run the script for infinite time.
In Apache you can change maximum execution time by .htaccess with this line
php_value max_execution_time 200
set_time_limit() php manual ref.