Topic: Install php apc extension?

I wanted to implement an upload progress bar in the SuperTuxKart addon-manager (stkaddons.net), but it requires the APC extension for PHP. This is a PECL extension.

A simple example of what I intend to do is below:
http://webreflection.blogspot.com/2007/ … c-and.html

Could a server admin install the apc extension?
(the following lines also need to be added to php.ini:
extension=php_apc.so
apc.rfc1867 = On

Thanks!

Re: Install php apc extension?

Hi Stephen,

Well, this is not going to work at all, because it requires:

- APC needs shared memory between PHP processes, since we are doing processes isolation for security you're not going to be able to create a working shared memory region.
- Even if shared memory was available, this require that all PHP scripts are running on the same host to be able to fetch the data in the shared memory, in this case this is the current amount of data already sent. Due by load balancing of PHP load on several hosts you can't rely on the fact that the same host is going to serve your PHP pages during all the upload time.

Alternatively, this could be done through a tiny SQL database to share the data between hosts and then act as a dirty shared-memory subsystem. Using MySQL, the memory engine would do the job.

Sylvain

Re: Install php apc extension?

Thanks for your quick feedback.
Do you happen to know if that also means the "uploadprogress" PECL extension won't work? As far as I'm aware, that one doesn't use shared memory, but actually looks at the temp file on the disk during the upload... which wouldn't be guaranteed to be on the same host as the script is running...

This is beginning to sound much too complicated for what the feature is worth. A mysql database just for this seems like too much.

Thanks again!

Re: Install php apc extension?

Hi,

Anything that don't use shared memory will work. Temporary files will work, they are shared between hosts through a NFS share. Moreover the load balancer have persistence enabled, so it will try, as much as possible, to glue client to one host.

Sylvain