Problem with set_time_limit() and uploading large files
| From: | derek fong | Date: | Fri, 25 Oct 2002 15:36:09 +0000 |
| Subject: | Problem with set_time_limit() and uploading large files | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-121438@lists.php.net to get a copy of this message | ||
Hi,
I am having a major problem getting set_time_limit() to work at all with PHP 4.2.3 running as a CGI program under IIS for Windows 2000 (I originally posted this message to php-win, but am hoping someone here can shed some light on this). I have a form that accepts large files for upload, with the following lines at the top of the form action script:
<?php
// let this script take as long as it needs to complete its work
// and ignore if user hits stops button in his browser
set_time_limit(0);
ignore_user_abort(true);
// include site-wide configs and other include files
require_once('../includes/site.php');
...
If the file upload takes longer than 30 seconds, PHP bombs out with the following error:
"Fatal error: Maximum execution time of 30 seconds exceeded in D:\InetPub\test.php on line 3"
I've also tried adding:
ini_set('max_execution_time', 60000);
before the set_time_limit() function, but to no avail. PHP is not running in safe mode. Does anyone have any ideas why this is not working as expected? I'm sure it's something obvious, but I don't know what it is.
Thanks in advance,
-f
--
Derek Fong
Web Application Developer
subtitle designs inc. <http://www.subtitled.com/>
"Mistakes are the portals of discovery." --James Joyce
>> GPG key/fingerprint available upon request <<