Login | Packages | Support | Bugs 

Package home | Report new bug | New search Status: Open | Feedback | All

Bug #8663 APC load 2 times the same file after a "SVN Export"
Submitted: 2006-09-08 12:36 UTC Modified: 2008-10-26 16:06 UTC
From: le dot spam dot c dot mal at gmail dot com Assigned: shire
Status: Closed Package: APC
Version: 5.1.2 OS: Linux
[2006-09-08 12:36 UTC] le dot spam dot c dot mal at gmail dot com
Description:
------------
My website is under a svn repository

I use PHP 5.1.2 on ubuntu dapper and the last APC Version

Every day, a cron do a "svn export" of the php files of my website.
After the export, I always have the error "already declared class".
When I look to the apc.php, it shows me that the same file is indexed
two times...

I use the __autoload() method, but I don't think this is the problem
(because __autoload is called only if the class doesn't exist)

It's just APC which loads 2 times the same file apparently after svn
(even if svn didn't modify any file...)
[2006-09-08 14:21 UTC] gopalv
I'd like to take a look at your apache log, please.
[2006-09-08 14:26 UTC] gopalv
Btw, unless you are using no_stat mode, multiple copies in apc cache
listing isn't unexpected or wrong, especially when modifying files live
in production.
[2006-10-23 14:51 UTC] le dot spam dot c dot mal at gmail dot com
(argh, my comment was lost, I have to rewrite it...)

Hello,

Where do you specify the no_stat mode ?

Here are my steps : 
1/ load my PHP page, everything works fine
2/ "svn export" in the /var/www folder
(the svn export doesn't modify all the php files all the times, so a lot
of times, it's always the same php file after each svn export)
3/ reload my PHP page : ERROR
(PHP Fatal error:  Cannot redeclare class ...)
4/ "clear opcode cache" in apc.php
5/ reload PHP page : everything works fine again !
6/ reload again, still works until I do another svn export

I have nothing special in my apache logs (access.log/error.log)

Thanks.
[2006-12-10 07:42 UTC] shire at php dot net
I've added a apc.stat_ctime flag to CVS.  It's set to 0 by default, but
setting it to "apc.stat_ctime=1" in your ini file should correct the
problem you're experiencing.  

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.
[2008-03-14 20:48 UTC] tunguska56 at yahoo dot com
I spent like 2 hours googling around for the solution in this bug, with
the apc.stat_ctime=1.

Can someone kindly document this new APC option on php.net, along with
the rest of the usual APC docs?
[2008-10-21 00:34 UTC] fred dot cohen at iridium dot com
This still isn't documented!
[2008-10-26 16:06 UTC] kalle
This have been documented in the php.net sources :)
PRIVACY POLICY | CREDITS
Copyright © 2001-2008 The PHP Group
All rights reserved.
Last updated: Fri Aug 07 10:22:05 2009 UTC
Bandwidth and hardware provided by: pair Networks