Solved

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

Posted on 2011-02-28
4
543 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 implement server side field validation and display customized error messages to the client.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

737 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