Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 5743

php-manual-en-5.5.7-1.mga4.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Limits the maximum execution time</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.set-magic-quotes-runtime.html">set_magic_quotes_runtime</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.sys-get-temp-dir.html">sys_get_temp_dir</a></div>
 <div class="up"><a href="ref.info.html">PHP Options/Info Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.set-time-limit" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">set_time_limit</h1>
  <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">set_time_limit</span> &mdash; <span class="dc-title">Limits the maximum execution time</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.set-time-limit-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type"><span class="type void">void</span></span> <span class="methodname"><strong>set_time_limit</strong></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$seconds</code></span>
   )</div>

  <p class="para rdfs-comment">
   Set the number of seconds a script is allowed to run. If this is reached,
   the script returns a fatal error. The default limit is 30 seconds or, if
   it exists, the <em>max_execution_time</em> value defined in the
   <var class="filename">php.ini</var>.
  </p>
  <p class="para">
   When called,  <span class="function"><strong>set_time_limit()</strong></span> restarts the timeout
   counter from zero. In other words, if the timeout is the default 30
   seconds, and 25 seconds into script execution a call such as
   <em>set_time_limit(20)</em> is made, the script will run for a
   total of 45 seconds before timing out.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.set-time-limit-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>

    <dt>

     <span class="term"><em><code class="parameter">seconds</code></em></span>
     <dd>

      <p class="para">
       The maximum execution time, in seconds. If set to zero, no time limit
       is imposed.
      </p>
     </dd>

    </dt>

   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.set-time-limit-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   No value is returned.
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.set-time-limit-notes">
  <h3 class="title">Notes</h3>
  <div class="warning"><strong class="warning">Warning</strong>
   <p class="para">
    This function has no effect when PHP is running in <a href="ini.sect.safe-mode.html#ini.safe-mode" class="link">safe mode</a>. There is
    no workaround other than turning off safe mode or changing the time limit
    in the <var class="filename">php.ini</var>.
   </p>
  </div>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    The  <span class="function"><strong>set_time_limit()</strong></span> function and the configuration 
    directive <a href="info.configuration.html#ini.max-execution-time" class="link">max_execution_time</a>
    only affect the execution time of the script itself.  Any time spent on
    activity that happens outside the execution of the script such as system
    calls using  <span class="function"><a href="function.system.html" class="function">system()</a></span>, stream operations, database
    queries, etc. is not included when determining the maximum time that the
    script has been running.
    This is not true on Windows where the measured time is real.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.set-time-limit-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><a href="info.configuration.html#ini.max-execution-time" class="link">max_execution_time</a></li>
    <li class="member"><a href="info.configuration.html#ini.max-input-time" class="link">max_input_time</a></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.set-magic-quotes-runtime.html">set_magic_quotes_runtime</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.sys-get-temp-dir.html">sys_get_temp_dir</a></div>
 <div class="up"><a href="ref.info.html">PHP Options/Info Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>