Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is there any way to enable/disable APC on a per virtual host basis? I'd rather not use precious apc shared memory on caching my PHPmyAdmin subdomain or lesser used sites. Setup is Nginx, php-fpm, and apc.

From what I've read the filter setting of APC cannot match against full path so I am looking for some other method.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You would have to set up two separate pools of php "workers" in your php-fpm.conf, each using a different php_defines as well as a different port. One would have APC enabled, one would not. How to enable or disable APC would depend on if you built it into the PHP executable or not. If it is built in, you'd add apc.enabled=0 in one php_defines to disable it in that worker pool. Otherwise, you'd remove the extension=apc.so from your default .ini file and move it into one of the php_defines to enable it in that worker pool.

In nginix, you should be able to set which worker pool gets used on a per-location basis by putting the correct port in fastcgi_pass. You could test if its working or not by creating a small script calling phpinfo() in each location and checking the output for APC.

share|improve this answer
    
Happy to hear there's support for multiple pools. I thought that I might have to install php-fpm twice and rename the second instance and do some other nastiness. I get the gist and will check the documentation for specifics. Do you have any additional reference material? Thanks! –  CarpeNoctem Jan 18 '11 at 8:40
    
I think the APC flag is called apc.enabled=0 –  liecno Apr 30 '13 at 14:02
    
@liecno thanks, I fixed it. –  DerfK Apr 30 '13 at 17:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.