|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57375 APC upload feature fails if filesize larger than upload_max_filesize
Submitted: 2006-11-14 04:13 UTC Modified: 2014-02-28 12:37 UTC
Avg. Score:3.8 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: krudtaa at yahoo dot com Assigned: krakjoe (profile)
Status: Closed Package: APC (PECL)
PHP Version: 5.2.0 RC4 OS: Windows XP Pro
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: krudtaa at yahoo dot com
New email:
PHP Version: OS:


 [2006-11-14 04:13 UTC] krudtaa at yahoo dot com
Actually using PHP 5.2.0

Regarding new upload feature for PHP 5.2 when using the APC extension.

If total upload filesize is above upload_max_filesize and post_max_size then upload progress meter will not work, because the "APC_UPLOAD_PROGRESS" object has not been stored in APC cache I belive, and the requested script will report back:

Notice: Undefined index: APC_UPLOAD_PROGRESS in PATH-TO-FILE\progress-custom.php on line 83

Reproduce code:
Take the source from:

then modify it so it does not use the YUI libs but your own javascript "AJAX" like calls to the server:

Then make sure the form is submitted to server the "normal" way.

Then submit enough files so total filesize gets above the value in upload_max_filesize and post_max_size (mine was set to 350M).

Note: I also tested the original script found here: on my own server the same way.... progress meter does not get updated, and after a while it just hangs.... but because of the use of YUI libs I do not get back the error message from the server script.

I used something like this for the "AJAX" like calls to server in my modified version:

function checkUpload(){
  var progress_key =  
  var url = 
  // Create new JS element
if( document.getElementById && document.childNodes && 
    document.createElement ) {
   var jsel = document.createElement('SCRIPT');
   jsel.type = 'text/javascript';
   jsel.src = url;
   // Append JS element (therefore executing the 'AJAX' 
   document.body.appendChild (jsel);
} else {
  alert("Your browser does not support this 
    feature!\n\nBrowsers that support it are: Explorer, 
    Firefox, Netscape, Opera, Safari 2.0");

Expected result:
The new upload extension in APC should create the APC object and set cancel_upload to a correct value.

It should do this pretty fast without having to wait for all the files to get uploaded before it do so.

Actual result:
No files seem to be created in php temp dir.

Progress meter not updated, probably because the APC upload feature fails to create the object in the cache.

Then after a while the requested script sends back this:

Notice: Undefined index: APC_UPLOAD_PROGRESS in C:\www\Apache2\htdocs\uploadtest\progress-custom.php on line 83


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-25 07:41 UTC]
This is technically not an APC bug as the file upload hooks are not called at all in this case.  I'll keep it here since I need to have a look at it in PHP.
 [2007-09-17 19:10 UTC] mail at picsent dot com
You can try to test it by using the uploader at if you want. its problay the quickeest way.
 [2008-11-09 04:34 UTC] krudtaa at yahoo dot com
I have reported the bug here:
 [2014-02-28 12:37 UTC]
-Status: Analyzed +Status: Closed -Assigned To: +Assigned To: krakjoe
 [2014-02-28 12:37 UTC]
Closing this bug for several reasons:

 5.2 is no longer supported software.
 APC is no longer the primary means of caching opcodes.
 I wouldn't expect APC to be able to over-ride the servers settings anyway.

Thanks for helping to make PHP better :)
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun May 29 03:03:49 2022 UTC