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?
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.