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

We have a PHP application that has 3 web servers (running Nginx and Apache). The web server's directory root are symlinked directories that point to an NFS mount. For example:

web01 has an NFS mount at /data/webapp, which is symlinked to /home/webapp. Apache serves content from /home/webapp/www.

We also use ACP for our PHP opcode cache. When we deploy code, we SCP an archive file to the NFS server and extract it.

Since upgrading RedHat 6, when we deploy our code the webserver execute "stale" PHP files until touch is run on the PHP files. We thought that APC might be causing a problem, but the issue exists, even after clearing the opcode cache.

Any ideas on how to diagnose why the stale PHP code is being executed?

share|improve this question
Do you have any similar problems with non-PHP files? Have you tried disabling APC all together to check? (I mean, besides clearing the cache). – El Barto Jun 11 '12 at 17:53
@ElBarto I disabled APC and have the same problem. Static files with Nginx seem to be served correctly... – mmattax Jun 11 '12 at 19:02
PHP scripts are executed by Nginx or Apache? If it's Apache, can you check what happens if you serve a non-PHP file with Apache? – El Barto Jun 11 '12 at 20:29
@ElBarto I did a few tests, Apache is serving stale files. – mmattax Jun 11 '12 at 23:48

That looks rather like editing-files-in-place issue. If you would be hitting this with nginx I'd recommend looking into your config for the open_file_cache parameter, but almost the same thing happens inside of apache2 or php. The server caches file handles and totally misses a point when file changes failing to invalidate cache.

If apache is involed you can fix this once by issuing htcacheclean command and verifying that content was updated. If this is the case you need too peruse manual on disk caching. If not you should continue stripping php modules.

share|improve this answer
is htcacheclen only applicable when using mod_cache? We're not using that module... – mmattax Jun 11 '12 at 23:49
This is rather about mod_file_cache. If it's not enabled I think you should proceed with php. I assume you can reproduce this issue on non-NFS mount so NFS caching can be left behind. – kworr Jun 12 '12 at 7:36

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.