Solved

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

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
comma true 6 37
How is this connection happening? 3 20
mysql query for sum() 3 28
PHP alternative to file_get_contents('php://input') 4 60
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
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 dynamically set the form action using jQuery.
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.

840 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