By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,572 Members | 964 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,572 IT Pros & Developers. It's quick & easy.

Abort php script

P: n/a
Hi!

Iam wondering how u can abort php script execution if itsn't done efter f
ex 60 s?

--
just keep swiming
Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hi Caramba,

Check your php.ini and find this:

;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;

max_execution_time = 30 ; Maximum execution time of each script, in
seconds
memory_limit = 8M ; Maximum amount of memory a script may consume (8MB)
Speaks for itself I think.

Good luck!

Regards,
Erwin Moller
Jul 17 '05 #2

P: n/a
well, I know that, but I have script that some time can't execute it seft
and the page loading wount and for ever... thats why I waht to set abort
time

carramba

Erwin Moller
<si******************************************@spam yourself.com> skrev den
Tue, 04 May 2004 17:36:38 +0200:
Hi Caramba,

Check your php.ini and find this:

;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;

max_execution_time = 30 ; Maximum execution time of each script, in
seconds
memory_limit = 8M ; Maximum amount of memory a script may consume
(8MB)
Speaks for itself I think.

Good luck!

Regards,
Erwin Moller


--
just keep swiming
Jul 17 '05 #3

P: n/a
carramba a écrit le 04/05/2004 :
well, I know that, but I have script that some time can't execute it seft
and the page loading wount and for ever... thats why I waht to set abort
time


Check your server instead. If it is just "from time to time" for the
same script doing the same thing (on the same amount of data) then it
is not a PHP problem...
Otherwise as introduced before use max_execution_time and ini_set()
function to change this value in a specific script.
http://www.php.net/ini_set
Jul 17 '05 #4

P: n/a
Jedi121 <je*********@free.fr.Removethis> wrote:
carramba a écrit le 04/05/2004 :
well, I know that, but I have script that some time can't execute it seft
and the page loading wount and for ever... thats why I waht to set abort
time


Check your server instead. If it is just "from time to time" for the
same script doing the same thing (on the same amount of data) then it
is not a PHP problem...
Otherwise as introduced before use max_execution_time and ini_set()
function to change this value in a specific script.
http://www.php.net/ini_set


If for some other reason you need to exit the php script, you can do a
timestamp in the start of the script, the do a compare where you want it
to exit. then you can for instance do like this:

$timestamp = date();

....
if( $timestamp < strtotime("-60 seconds") )
{
exit();
}
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.