php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57223 APC ignores include files
Submitted: 2006-09-08 12:24 UTC Modified: 2009-02-16 20:26 UTC
From: walzer at owcd dot ch Assigned:
Status: No Feedback Package: APC (PECL)
PHP Version: 5.1.6 OS: Debian/Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: walzer at owcd dot ch
New email:
PHP Version: OS:

 

 [2006-09-08 12:24 UTC] walzer at owcd dot ch
Description:
------------
Unfortunately, we experienced kind of weird problem when using the APC cache on our web servers. Therefore, we disabled the cache and were trying to figure out the problem on just one slave web server. This server does around 600 cache requests per second. It seams that under given circumstances some files are not included correctly. We're using Propel (http://propel.phpdb.org/) for data persisting and the problem only occurred with these class files. As the include file structure is quite complex, there might be a case where APC caching fails.

We're using the latest APC version 3.0.12p2 with Apache/1.3.37 (Unix) PHP/5.1.6

Reproduce code:
---------------
I put a set of file to reproduce the error under: http://www.owcd.ch/apc.tar.gz. Unfortunately, it is not easy to reproduce the error and I was only able to see it once with these Test Classes. But it happens frequently with the running code, which has the same structure of the include files. This test case is, therefore, just a model for the problem in our application which has many of those include files. To see the point where the problem appears, please have a look in the test1.php and test2.php scripts. The only difference you can see is the include file they are requiring (by following the include and requires you can see, that the same files are included). While test2.php always works, test1.php fails sometimes with the error that the class BaseTestPeer cannot be found even if it is required at line 4 of the TestPeer.php file. An interesting thing happens, when I change the file TestPeer.php so it needs to get cached again. Then it is possible, that the error does not occur again. The cache and the whole application then runs without any problems for hours. But, if the file got changed, the web server got restarted or the cache got cleared, the problem can come up again. It really seams that APC sometimes misses the require_once 'test/om/BaseTestPeer.php' tag in TestPeer.php.

Expected result:
----------------
BaseTestPeer.php is included into TestPeer.php and, therefore, the class BaseTestPeer is defined.

Actual result:
--------------
The definition of the class BaseTestPeer does not exist and __autoload gets called to load the class definition (or if there is no __autoload a fatal error is issued).

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-12 12:58 UTC] dwstevens at gmail dot com
We downloaded the test files, as we are having the identical problem, on Ubuntu 6.10 Edgy Eft with PHP 2.0.58 and PHP 5.1.6 from the main Ubuntu repository (not universe). We are also using propel for part of our application. I can do more testing or provide more information if needed. I just need to know what someone needs to know.
 [2007-02-25 03:47 UTC] rasmus@php.net
Please try 3.0.13
 [2009-02-16 20:26 UTC] shire@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2010-02-11 04:10 UTC] jasc at fynskemedier dot dk
We are experiencing the exact same problem.

It is NOT consistent to reproduce, but basically what happens is this:

<?pseudophp
require(file with definition of BaseClass);
class Classyness extends BaseClass { ...

The class definition og Classyness produces a call to the autoloader with BaseClass as parameter, beacause APC has ignored the require :(
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Jan 17 21:01:24 2020 UTC