php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56759 apc_cache_info() generates a warning with apc enabled by virtualhost
Submitted: 2005-12-29 09:34 UTC Modified: 2006-12-11 00:17 UTC
From: mauroi at digbang dot com Assigned: shire (profile)
Status: Closed Package: APC (PECL)
PHP Version: 5.1.1 OS: CentOS release 4.2
Private report: No CVE-ID: None
 [2005-12-29 09:34 UTC] mauroi at digbang dot com
Description:
------------
I have the following line in my php.ini

apc.enabled=0

But also enable APC for only one virtualhost:

php_flag apc.enabled on

If I call apc_cache_info() (in fact, the call is made from the provided APC.php) I get false and a warning.

Reproduce code:
---------------
<?
apc_cache_info();
?>

Expected result:
----------------
an array of cache information

Actual result:
--------------
false

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-29 09:36 UTC] mauroi at digbang dot com
I forgot to mention that APC.php is located in the documentroot of the VirtualHost that has APC enabled....
 [2006-08-22 18:02 UTC] ohoareau at gmail dot com
I had the same problems, and do it an other way :

1/ set apc.enabled=1 in php.ini
2/ set php_value apc.enabled Off in httpd.conf (in fact conf.d/apc.conf)
3/ set php_value apc.enabled On for the each selected Virtual Host I want to use APC.

It works for me with PHP 5.1, Apache 2.0, APC 3.0.11

Hope this could help :)

ohoareau.
 [2006-09-07 10:38 UTC] lasse at novicell dot dk
This bug still exist in 3.12pl2 - Doesn't seem like it works with .htaccess to enable the cache. I can turn it off with .htaccess without any problem.

Also phpinfo() shows correctly that its enabled, but its not caching anyfiles when only enabled in .htaccess

Would be neat to have this fixed :|
 [2006-12-11 00:17 UTC] shire@php.net
The apc.enabled flag should only be an INI_SYSTEM setting.  This has been corrected in CVS.  To allow configuration at the directory level the apc.cache_by_default option has also been changed to an INI_ALL value, so it can now be used to configure your virtual hosts. Thanks. (also same as bug #7816 http://pecl.php.net/bugs/bug.php?id=7816)
 [2008-10-08 23:57 UTC] xurizaemon at gmail dot com
I followed ohoareau's instructions, and found that per-virtualhost, using "php_value apc.enabled Off" did not resolve the issue for me.

However, "php_value apc.cache_by_default Off" achieved the same thing, which was effectively disabling APC for the VirtualHost I wanted it not to run on.

APC 3.0.19
PHP 5.2.0-8+etch11 (Debian)
Apache 2.2.3-4+etch5
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 28 00:01:28 2024 UTC