Web Hosting Talk







View Full Version : Php Maximum execution time on UPLOAD


kapot
01-19-2004, 05:15 AM
am attempting to upload a doc via PHP that is ~4MB (2MB files seems to work fine). I have these settings in my PHP.ini:

max_execution_time=3600
memory_limit=50M
upload_max_filesize=50000000

And yet I get this error:

Fatal error: Maximum execution time of 3600 seconds exceeded in F:\Program Files\Apache Group\Apache2\htdocs\administrator\index2.php on line 18

And this happens once it has 'completed' the upload, as an hour has not gone by for a real timeout.

Any ideas? Any specific Apache settings I should be aware of?

I have also tried adjusting the timeout directive within Apache as well as adding this to the apache config, still no joy:

#
# Cause the PHP interpreter handle files with a .php extension.
#
<Files *.php>
SetOutputFilter PHP
SetInputFilter PHP
LimitRequestBody 9524288
</Files>

saintly
01-19-2004, 06:09 AM
Lower your upload limit to a minute or so and try to upload a small file and see if it does the same thing for smaller limits.

After that, make sure your PHP is not running in SAFE MODE and then add this to the top of your file:

set_time_limit(0);

Give it a go and let me know..

kapot
01-19-2004, 07:29 AM
It's no problem with 2 MB files as I stated above.

I did a default install of my PHP v4.x platform and do not believe it is running in Safe Mode. What are the php.ini params for confirming this?

Also, on the set_time_limit, that is on a script by script basis, correct? As opposed to a global setting in php.ini? I am using some precanned scripts, and while I can hack, would prefer a global solution to the problem. Unless I am wrong on my assumptions?

kapot
01-19-2004, 08:46 AM
I also found this in the apache error log :

[Mon Jan 19 10:28:46 2004] [error] an unknown filter was not added: PHP
[Mon Jan 19 10:32:14 2004] [error] an unknown filter was not added: PHP
[Mon Jan 19 10:32:14 2004] [error] an unknown filter was not added: PHP

saintly
01-19-2004, 01:49 PM
Yes the set_time_limit is not global, but it would help to isolate the problem.

In php.ini, do a search for "safe", it's the only parameter in there. For the error message, seems wierd! Are they only popping up when you try to upload?

IGobyTerry
01-19-2004, 03:15 PM
EDiT: Nevermind. Dumb suggestion. Won't help at all.