Solved

How to set the max_execution_time to something lower than default during runtime?

Posted on 2011-02-28
4
494 Views
Last Modified: 2012-05-11
How to set the max_execution_time to something lower than default during runtime?

I tried ini_set('max_execution_time', 1); and the script will run for more than 1 second.  I do not want to change the default setting in php.ini file.  This is only going to apply to a single method.
0
Comment
Question by:computerhxr
  • 2
4 Comments
 
LVL 12

Accepted Solution

by:
larsrohr earned 500 total points
ID: 35004234
You can try overriding the max_execution_time within your php script itself, using the command:
   set_time_limit ( 1 );
0
 

Author Comment

by:computerhxr
ID: 35004278
set_time_limit (1); adds 1 second to the max_execution_time
0
 
LVL 12

Expert Comment

by:larsrohr
ID: 35004312
It shouldn't:  http://www.php.net/manual/en/function.set-time-limit.php
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 the php.ini.

However, you need to have this near the top of your script, because it resets the count when the call to set_time_limit is made.
0
 
LVL 15

Expert Comment

by:Insoftservice
ID: 35004314
Hi,

create an .htaccess file  in root folder it would resolve ur all execution time issue
and paste

RewriteEngine On
php_value post_max_size 1000M
php_value upload_max_filesize 2500M
php_value max_execution_time 6000000
php_value max_input_time 6000000
php_value memory_limit 2500M
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now