2

I tried to increase the max execution time in my php.ini file. It doesn't work, however. Considering the fact that I' ve got a large file (containing 300 pages) I have to download using PHPEXCEL, I did the following in my php. ini file:

max_execution_time = 999999999     
max_input_time = 9999999    
max_input_nesting_level = 64  
memory_limit = 128M      

Is there anyone who knows what to do in this situation?

4
  • What size was the file? Commented Apr 21, 2015 at 16:07
  • What exactly does not work? Do you have an error message? How big in terms of MB is your file? I really doubt that 999999999 seconds execution time is not enough to download an Excel file. Commented Apr 21, 2015 at 16:07
  • Here is the error message I have: <b>Fatal error</b>: Maximum execution time of 30 seconds exceeded in <b>C:\wamp\www\clinique\scripts\utilisateur\Classes\PHPExcel\Shared\Font.php</b> on line <b>374</b><br />. the size is 2 MO but when I download I just have 1 KO Commented Apr 21, 2015 at 16:14
  • You probably have to ensure that your settings changes are applied, did you resatart the server ? Commented Apr 21, 2015 at 16:23

3 Answers 3

4

You can use 0 :

max_execution_time = 0     

That will disabled the limitation. Don't forget to restart apache after.

You can also user the PHP version :

<?php set_time_limit(0); ?>
Sign up to request clarification or add additional context in comments.

2 Comments

Thx. Let me try and tell you what.
You're welcome. Don't hesitate to valid the answer so.
0

If you don't want a limit, then you can use this:

set_time_limit(0);

But only if safe_mode is off, otherwise you can use ini_set:

ini_set('max_execution_time', 300); // 300 Seconds

Thanks.

2 Comments

Thx, Do I have in that case delete the line max_execution_time: 999999?
You would replace it yes.
0

On some of my php scripts that take long time to run I always use the following code at the top:

set_time_limit(0);
ignore_user_abort(1);

Explanation:

set_time_limit(0);

We're telling php the script can run for unlimited time.

ignore_user_abort(1);

We're telling php to continue running the script even if the user disconnects.
i.e.: closing the browser or disconnect from a SSH session.

1 Comment

Thx so much. I 'll try and tell you about it

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.