WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
PHP Web Logs (BLogs)
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Submit Site
Forex Trading Online forex trading platform

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Changing the default 30 seconds time limit of PHP scripts
Categories : PHP, PHP Options and Info
Boaz Yahav
Date : Jul 24th 1999
Grade : 3 of 5 (graded 6 times)
Viewed : 5983
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Boaz Yahav
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 

QUESTION
=======

I'd like to know if it's possible to make the global 30-second time limit
that PHP3 has, to make it 5 minutes for example for a specified Virtual
host, or even for a directory.


Answer
=====


Use the set_time_limit() function :

set_time_limit -- limit the maximum execution time


Description
========

void set_time_limit(int seconds);

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 max_execution_time value
defined in php3.ini. If seconds is set to zero, no time limit is imposed.

When called, set_time_limit() 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
set_time_limit(20) is made, the script will run for a total of 45 seconds before timing out.

NOTE : This function can't be used if you are running under safe mode




PHP, simple, counter, bala
Categories : HTML and PHP, PHP, PHP Options and Info
Security, Password lock out after three tries, authorization fails and is logged locked out of account till admin decides he will unlock it.
Categories : Sessions, PHP, MySQL, PHP Options and Info
PhpView 0.1 - simple php viewer, using temporary files and frames.
Categories : PHP, PHP Options and Info, Debugging, HTML and PHP
dl -- load a PHP extension at runtime
Categories : PHP, PHP Functions, PHP Options and Info
Simple PHP program which calls other PHP program you can pass the variables to other PHP program : by Raju
Categories : PHP, PHP Options and Info, Regexps, Program Execution
PHP and IE 6. The new privacy option in IE 6 blocks an important cookie if you ever want a session.
Categories : PHP, PHP Options and Info
Pageinfo: Array containing page URI, page query string (parameters), request method (GET or POST) and the complete URI
Categories : Variables, PHP Options and Info, Arrays, URLs, PHP
Step by Step installation manual for PHP4.1.x on Windows 2000 based systems running IIS5 using CGI or ISAPI
Categories : PHP, PHP Configuration, PHP Options and Info, Windows 2000
Query2Report : Generating Html, Pdf and Csv Reports from SQL Query
Categories : PHP, PHP, HTML, PDF, Excel
Make your PHP 4.1 (or higher) script compatible with PHP 4.0 (still used by some prviders)
Categories : PHP, PHP Options and Info, Variables
Sessions and -enable-trans-sid
Categories : PHP, PHP Configuration, PHP Options and Info, Sessions
database,php,mysql,demo,example,php3,training,tutorial,codes,code
Categories : Databases, MySQL, PHP, PHP Options and Info
Retrieve text from table and email to your e- address in pipe delimited format.
Categories : PHP, MySQL
Accepts a database & hostname from a user and then HTTP username and password. Uses this to connect to a MySQL database. Produces a form based on the tables it finds there to allow the user to do SELECTs, INSERTs, and DELETEs.
Categories : Databases, PHP, MySQL, Complete Programs
PHP Script to find url links in a page
Categories : PHP, URLs, Regexps, Arrays