Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was planning to use APC for my Apache Server based on mpm_worker and mod_fcgid but I found out that APC and also xCache doesn't work with mod_fcgid. so what do you suggest?

share|improve this question
It works for me just fine, both of them. I used virtualmin to configure it and I added APC or xcache and it was working good, however APC seems to be more decent. – Andrew Smith Sep 17 '12 at 18:59
Thanks, take a look at comments here. I have tried it but it doesn't seem to be working for me. – Zim3r Sep 17 '12 at 19:21
It's all working fine. It's just not a shared cache. This is OK solution in many cases. It's not like it's not working. It's all fine working just with no cache sharing between instances. – Andrew Smith Sep 17 '12 at 22:59
Yes I know what you mean. does menarche capable of sharing cache between instances? Thanks – Zim3r Sep 18 '12 at 6:36
To be honest, I would have to find out and make tests. But I do believe if you map the RAM via file in /tmp/, it will be working OK, that the cache will be shared. – Andrew Smith Sep 18 '12 at 9:22
up vote 1 down vote accepted

The following works well for me. This one is with single process but it works stable with e.g. two.


LoadModule fcgid_module modules/
AddHandler fcgid-script fcg fcgi fpl
FcgidIPCDir /var/run/mod_fcgid
FcgidProcessTableFile /var/run/mod_fcgid/fcgid_shm
DefaultMaxClassProcessCount 1
FcgidMaxProcesses 1
FcgidMaxRequestsPerProcess 1000


export PHPRC
umask 022
exec /usr/bin/php-cgi


apc.enabled = 1
apc.shm_segments = 1
apc.shm_size = 512M
apc.num_files_hint = 1000
apc.user_entries_hint = 4096
apc.ttl = 0
apc.user_ttl = 0
apc.gc_ttl = 3600
apc.cache_by_default = 1
apc.filters = "apc\.php$"
apc.mmap_file_mask = "/tmp/apc.XXXXXX"
apc.slam_defense = 0
apc.file_update_protection = 2
apc.enable_cli = 0
apc.max_file_size = 10M
apc.use_request_time = 1
apc.stat = 1
apc.write_lock = 1
apc.report_autofilter = 0
apc.include_once_override = 0
apc.localcache = 0
apc.localcache.size = 256M
apc.coredump_unmap = 0
apc.stat_ctime = 0
apc.canonicalize = 1
apc.lazy_functions = 1
apc.lazy_classes = 1
share|improve this answer

Your Answer


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.