Fixing include_once and require_once errors when using PHP, APC, and Subversion to deploy websites

If your files are getting included or required more than once in PHP scripts and you're using APC and Subversion, you need to make sure you set this configuration variable to avoid problems:

 apc.stat_ctime=1

Quote from the PHP developers:

SVN (like rsync and other applications) actually creates new files,
replaces the old ones, and back dates the files.  This causes the inodes
to change, but not the mtime and apc will execute the incorrect file. 
Turning on ctime verification will avoid this problem by making sure the
inodes have not changed since the last stat.  Please let us know if this
does not fix your problem.
php_apc_and_subversion.txt · Last modified: 2013/01/21 12:44 (external edit)