I'm using apc_fetch to show a progress bar when I'm uploading a big file (a video).
The apc_fetch works ok with file up to 180mb. But with bigger file, apc_fetch returns false after 190Mb.
Basically if I upload a big file (250mb) it shows data until 'current' is < 190mb. When it comes to 190mb it returns false. no data.
My apc conf in php.ini
extension=apc.so
apc.rfc1867 = on
apc.max_file_size = 1024M
upload_max_filesize = 1024M
post_max_size = 1025M
apc.shm_size = 512M
apc.rfc1867_freq= 0
An update about it: Still making some tests and I found that the apc_fetch starts return empty afer 1 hour (60min). I set those up, but still getting the same.
apc.ttl = 0
apc.user开发者_JS百科_ttl = 0
apc.gc_ttl = 0
I think that the problem is something with the time.
You need to set apc.rfc1867_ttl
to a larger value. It determines how long the upload tracking values live in the apc cache.
Default value is 3600 seconds, after this time the upload is no longer tracked. That's why you see it returning nothing after an hour. Set it to a value somewhat higher than the longest time you expect an upload to take.
Look, I don't know if this will help you at all, but I had an APC problem a little while back after upgrading to the newest version where the information just wouldn't be retrieved after it was stored.
I was tearing my hair out trying to work out why it wasn't working. I rebooted the server and it worked again. No problems since (a week and a bit ago). I suspect there could be some sort of bug that may have been triggered.
So consider rebooting the server if that is an option for you and see if that helps.
FYI. I wasn't dealing with large files so the issue may be unrelated.
Make sure that upload_max_filesize and post_max_size are larger than the file you are uploading. As far as I can tell, apc.max_file_size does not affect it.
Also you need to change apc.rfc1867 = 0 to 10k or 100k
The frequency that updates should be made to the user cache entry for upload progress. This can take the form of a percentage of the total file size or a size in bytes optionally suffixed with "k", "m", or "g" for kilobytes, megabytes, or gigabytes respectively (case insensitive).
精彩评论