Solved

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

Posted on 2011-02-28
4
550 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

Technology Partners: 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

These days socially coordinated efforts have turned into a critical requirement for enterprises.
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

724 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