|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57221 APC load 2 times the same file after a "SVN Export"
Submitted: 2006-09-08 08:36 UTC Modified: 2008-10-26 11:06 UTC
From: le dot spam dot c dot mal at gmail dot com Assigned: shire (profile)
Status: Closed Package: APC (PECL)
PHP Version: 5.1.2 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: le dot spam dot c dot mal at gmail dot com
New email:
PHP Version: OS:


 [2006-09-08 08:36 UTC] le dot spam dot c dot mal at gmail dot com
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...)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-08 10:21 UTC] gopalv82 at yahoo dot com
I'd like to take a look at your apache log, please.
 [2006-09-08 10:26 UTC] gopalv82 at yahoo dot com
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 10:51 UTC] le dot spam dot c dot mal at gmail dot com
(argh, my comment was lost, I have to rewrite it...)


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)

 [2006-12-10 02:42 UTC]
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 15: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, along with the rest of the usual APC docs?
 [2008-10-20 20:34 UTC] fred dot cohen at iridium dot com
This still isn't documented!
 [2008-10-26 11:06 UTC]
This have been documented in the sources :)
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon Sep 26 16:05:54 2022 UTC