|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #59312 apc.stat off should include path when determining whether a stat is needed
Submitted: 2010-07-16 13:45 UTC Modified: 2010-08-08 16:38 UTC
From: steve-pecl-bugs at spamwiz dot com Assigned:
Status: Wont fix Package: APC (PECL)
PHP Version: 5.2.13 OS: CentOS 5
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:
Bug Type:
From: steve-pecl-bugs at spamwiz dot com
New email:
PHP Version: OS:


 [2010-07-16 13:45 UTC] steve-pecl-bugs at spamwiz dot com
APC's apc.stat configuration setting is very useful, but can only be used in certain situations.  In servers with multiple virtual hosts, or any other situation with different include paths, this can make apc.stat unusable.

Reproduce code:
Two virtual hosts on the same host have some common include file names.  With apc.stat=0, APC will see their include files as being identical, since the relative path is the same.

Expected result:
APC should have an option to store the include_path (or a hash of the include_path) with the relative include file name.  When include() is called, APC would check to see if it had already cached a file with the same relative file path AND the same include_path.  If not, it would do the necessary stat() calls to find the correct file, and cache it.

While it would be nice if APC was smart enough to use a pointer system so that multiple include_path/relative file path combinations could reference the same real file, this would not be necessary.

Having this feature would allow a LOT more people to use the apc.stat feature.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-08 16:38 UTC] gopalv82 at yahoo dot com
APC does not use relative paths in nostat mode. If you use one, it does rewrite it using the current include_path.

If you want to avoid that, turn off apc.canonicalize.

But in which case, it'll be far slower than the stat mode, because apc hits realpath() a lot (and the realpath cache size needs to be tweaked as well).

Either way, people who use relative paths shouldn't really be using stat=0. It just doesn't work well enough.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Feb 22 22:01:27 2024 UTC