Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

When I change php code of an application I need to restart apache to make the new code effective.

$ sudo apachectl -l
Compiled in modules:

It is a pretty stock Ubuntu configuration of Apache. I only installed mod_itk and created some vritualhosts.

Any ideas?

APC Support enabled
Version 3.1.7
APC Debugging   Disabled
MMAP Support    Enabled
MMAP File Mask  no value
Locking type    pthread mutex Locks
Serialization Support   php
Revision    $Revision: 307215 $
Build Date  May 2 2011 19:00:42

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  no value    no value
apc.num_files_hint  1000    1000
apc.preload_path    no value    no value
apc.report_autofilter   Off Off
apc.rfc1867 Off Off
apc.rfc1867_freq    0   0
apc.rfc1867_prefix  upload_ upload_
apc.rfc1867_ttl 3600    3600
apc.serializer  default default
apc.shm_segments    1   1
apc.shm_size    32M 32M
apc.slam_defense    On  On
apc.stat    Off Off
apc.stat_ctime  Off Off
apc.ttl 0   0
apc.use_request_time    On  On
apc.user_entries_hint   4096    4096
apc.user_ttl    0   0
apc.write_lock  On  On
share|improve this question
Caching? If you do CTRL+F5 - does the page change? – Jensd Aug 28 '13 at 10:14
Server Version: Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.7 with Suhosin-Patch Server Built: Jul 12 2013 13:37:14 – Martijn de Munnik Aug 28 '13 at 10:43
I doesn't seem to be a caching issue. I tried to reload the page several times. Only when I restart apache I see the new php output. – Martijn de Munnik Aug 28 '13 at 10:43
did you enable apc with apc.stat=0 ? that would be the reason, you'd have to turn stat on – mauro.stettler Aug 28 '13 at 10:47
up vote 3 down vote accepted

You don't list us the PHP modules. You most likely have something like PHP Accelerator, XCache or similar in place, a front-end cache such as Varnish caching stuff or some other black magic you won't reveal us.

For the caches such as XCache, see their manual how to operate from this.

For the front-end caches such as Varnish, see their manual.

Other than that, it's hard to imagine what is actually caching your stuff.

share|improve this answer
I updated to original post with the APC config – Martijn de Munnik Aug 28 '13 at 11:49
apc_stat was turned off... – Martijn de Munnik Aug 28 '13 at 11:52

The apc.stat option is turned off.

apc.stat    Off Off

In this case APC won't re-read cached files, ever.

The documentation states:

If this setting is off, APC will not check, which usually means that to force APC to recheck files, the web server will have to be restarted or the cache will have to be manually cleared.

To avoid restarting the web server, manually clear the cache by having the web server serve a PHP script containing only:

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.