Abort php script

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • carramba

    Abort php script

    Hi!

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

    --
    just keep swiming
  • Erwin Moller

    #2
    Re: Abort php script

    Hi Caramba,

    Check your php.ini and find this:

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

    max_execution_t ime = 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

    Comment

    • carramba

      #3
      Re: Abort php script

      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
      <since_humans_r ead_this_I_am_s pammed_too_much @spamyourself.c om> skrev den
      Tue, 04 May 2004 17:36:38 +0200:
      [color=blue]
      > Hi Caramba,
      >
      > Check your php.ini and find this:
      >
      > ;;;;;;;;;;;;;;; ;;;;
      > ; Resource Limits ;
      > ;;;;;;;;;;;;;;; ;;;;
      >
      > max_execution_t ime = 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[/color]



      --
      just keep swiming

      Comment

      • Jedi121

        #4
        Re: Abort php script

        carramba a écrit le 04/05/2004 :[color=blue]
        > 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[/color]

        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_t ime and ini_set()
        function to change this value in a specific script.
        PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world.



        Comment

        • Henrik Hartz

          #5
          Re: Abort php script

          Jedi121 <jedi121news@fr ee.fr.Removethi s> wrote:
          [color=blue]
          > carramba a écrit le 04/05/2004 :[color=green]
          > > 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[/color]
          >
          > 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_t ime and ini_set()
          > function to change this value in a specific script.
          > http://www.php.net/ini_set[/color]

          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();
          }

          Comment

          Working...