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.

I've installed APC on my Gentoo LAMP server (Apache 2.2, PHP 5.2.13) and it's running fine (I see it in phpinfo()), but it's not actually doing any caching. Looking at apc.php, I can see that only 1.7% of its memory allocation is being used, which is one file of ~430kb. I'm running a CMS on the server (concrete5) which has hundreds of PHP files, so I'd expect cache utilisation to be a lot higher. Obviously it's being ignored, for some reason.

The relevant settings in php.ini are:

[apc]
apc.enabled = 1
apc.shm_size = 32

Other than that it's vanilla, as far as I know.

If it helps, here's the output of httpd -M:

Loaded Modules:
 core_module (static)
 authn_file_module (static)
 authn_default_module (static)
 authz_host_module (static)
 authz_groupfile_module (static)
 authz_user_module (static)
 authz_default_module (static)
 auth_basic_module (static)
 include_module (static)
 filter_module (static)
 deflate_module (static)
 log_config_module (static)
 env_module (static)
 expires_module (static)
 headers_module (static)
 setenvif_module (static)
 version_module (static)
 ssl_module (static)
 mpm_prefork_module (static)
 http_module (static)
 mime_module (static)
 status_module (static)
 autoindex_module (static)
 asis_module (static)
 info_module (static)
 suexec_module (static)
 cgi_module (static)
 negotiation_module (static)
 dir_module (static)
 actions_module (static)
 userdir_module (static)
 alias_module (static)
 rewrite_module (static)
 so_module (static)
 suphp_module (shared)
Syntax OK

and php -m:

[PHP Modules]
bcmath
calendar
ctype
curl
db
dbase
domxml
exif
ftp
gd
gettext
iconv
imap
mbstring
mcrypt
mime_magic
mysql
openssl
overload
pcre
posix
session
standard
sysvsem
sysvshm
tokenizer
xml
xslt
zlib

[Zend Modules]

Any ideas would be much appreciated!

share|improve this question
add comment

2 Answers

Have you added extension=apc.so somewhere in php.ini? This is exactly the most common error when trying to configure APC: not loading it.

share|improve this answer
    
Yep it's in there. It's definitely running, because I can see it in phpinfo() and when I run apc.php (which comes with the package) it shows its stats. –  melat0nin Oct 18 '11 at 21:11
    
FWIW: apc doesn't show up in your php -m; You must have different php.ini's for apache and cli? –  thinice Dec 6 '11 at 17:36
add comment

Make sure APC setting apc.cache_by_default = 1; Otherwise nothing will get opcode cached, only variables manually requested by code.

share|improve this answer
add comment

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.