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 got APC running on my Ubuntu 13.04 Server box for quite a while now. A couple of days ago, something, somewhere went wrong and now it's acting very strangely. I'll lay it out.

My PHP configuration files are in /etc/php5/mods-available. All of the configuration directories of PHP5 (/etc/php5/cli/conf.d, /etc/php5/fpm/conf.d, etc.) are symlinked to that directory. If I run php -i from a shell I get the config files for /etc/php5/cli/conf.d/* returned, which are exactly the same as config files anywhere. The relevant part for my question would be this:


apc

APC Support => disabled Version => 3.1.13 APC Debugging => Disabled MMAP Support => Enabled MMAP File Mask => /tmp/apc.XXXXXX Locking type => pthread mutex Locks Serialization Support => broken Revision => $Revision: 327136 $ Build Date => Oct 9 2012 20:29:11

Directive => Local Value => Master Value apc.cache_by_default => On => On apc.canonicalize => On => On apc.coredump_unmap => Off => Off apc.enable_cli => Off => Off apc.enabled => On => On apc.file_md5 => Off => Off apc.file_update_protection => 2 => 2 apc.filters => no value => no value apc.gc_ttl => 3600 => 3600 apc.include_once_override => Off => Off apc.lazy_classes => Off => Off apc.lazy_functions => Off => Off apc.max_file_size => 1M => 1M apc.mmap_file_mask => /tmp/apc.XXXXXX => /tmp/apc.XXXXXX apc.num_files_hint => 512 => 512 apc.preload_path => no value => no value apc.report_autofilter => Off => Off apc.rfc1867 => Off => Off apc.rfc1867_freq => 0 => 0 apc.rfc1867_name => APC_UPLOAD_PROGRESS => APC_UPLOAD_PROGRESS apc.rfc1867_prefix => upload_ => upload_ apc.rfc1867_ttl => 3600 => 3600 apc.serializer => default => default apc.shm_segments => 1 => 1 apc.shm_size => 128M => 128M apc.shm_strings_buffer => 4M => 4M apc.slam_defense => On => On apc.stat => On => On apc.stat_ctime => Off => Off apc.ttl => 3600 => 3600 apc.use_request_time => On => On apc.user_entries_hint => 4096 => 4096 apc.user_ttl => 7200 => 7200 apc.write_lock => On => On

This shows the option apc.enabled as On. However, my phpinfo.php (link above), which shows the configuration for PHP5-FPM shows this option as Off. Thing is, the commandline version of php (cli) and the version that runs on my webserver (fpm) use the exact same symlinked configuration files.

My APC seems to be caching, but it behaves strangely. Before when I emptied the cache and reloaded some pages on the Wordpress installs on my server I would see pages get cached right away. Now, it's stuck on the same Hits and Misses numbers for hours, and I can refresh as much as I want, nothing changes.

The apc.enabled option shows as 0 (Off) on that page as well, but it seems to be doing at least something. There's files in the opcode cache as well as in the usercache. It's behaving strangely and I'm getting a lot of contradicting settings returned from PHP. I'm at a loss here. Here's 20-apc.ini for good measure:


extension=apc.so
apc.enabled="1"
apc.stat = "1"
apc.max_file_size = "1M"
apc.localcache = "1"
apc.localcache.size = "128"
apc.shm_segments = "1"
apc.ttl = "3600"
apc.user_ttl = "7200"
apc.gc_ttl = "3600"
apc.cache_by_default = "1"
apc.filters = ""
apc.write_lock = "1"
apc.num_files_hint= "512"
apc.user_entries_hint="4096"
apc.shm_size = "128M"
apc.mmap_file_mask=/tmp/apc.XXXXXX
apc.include_once_override = "0"
apc.file_update_protection="2"
apc.canonicalize = "1"
apc.report_autofilter="0"
apc.stat_ctime="0"
If someone needs any other config files or part of them, I'm keeping an eye on this thread, please tell me.

share|improve this question
    
Have you scanned your php-fpm configurations for php flags? I once set a php flag in my php-fpm config and forgot about it. –  jeffatrackaid May 29 '13 at 18:56
    
I'll check my configs later today. I take it you mean php-fpm.conf and the files in pool.d? –  Nick Rutten May 30 '13 at 1:16
    
php_flag[display_errors] = off php_admin_value[error_reporting] = 0 php_admin_value[error_log] = /var/log/php5-fpm-error.log php_admin_flag[log_errors] = on php_admin_value[memory_limit] = 128M. These are all the php flags in my php-fpm configs. –  Nick Rutten May 30 '13 at 12:11

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.