|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57064 apc ini directives not working when used in htaccess file
Submitted: 2006-06-06 01:47 UTC Modified: 2006-12-11 00:17 UTC
From: soporte at onfocus dot cl Assigned: shire (profile)
Status: Closed Package: APC (PECL)
PHP Version: 5_1 CVS-2006-06-06 OS: Linux 64 bit
Private report: No CVE-ID: None
 [2006-06-06 01:47 UTC] soporte at onfocus dot cl

apc.enabled ini setting seems to have no effect in .htaccess config files even though documentation says it its changeable in PHP_INI_ALL.

Im using latest APC CVS and LATEST PHP 5_2 CVS.

Reproduce code:
httpd.conf --> AllowOverride All


then create an .htaccess file with :

php_flag apc.enabled On


php_value apc.enabled 1

and try with

print_r(apc_cache_info()); ?>

Expected result:
"an Array of cached data (and meta-data)"

Actual result:
Warning: apc_cache_info(): No APC info available. Perhaps APC is not enabled? Check apc.enabled in your ini file in /srv/www/vhosts/ on line 2 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-06-06 01:52 UTC] soporte at onfocus dot cl
same result using php_admin_flag and php_admin_value on httpd.conf, only setting apc.enabled from php.ini seems to work.
 [2006-06-06 01:58 UTC] soporte at onfocus dot cl
...and then if you look phpinfo() apc.enabled is set to On, but seems to do nothing..any idea ?
 [2006-06-07 00:27 UTC] gopalv82 at yahoo dot com
APC ini values are read before the initial apache forks and it cannot be set for directory therefore.

Probably the only apc ini value should be possible to modify post fork is the filter list, I suppose.
 [2006-06-07 22:44 UTC] soporte at onfocus dot cl
then :

Index: reference/apc/ini.xml
RCS file: /repository/phpdoc/en/reference/apc/ini.xml,v
retrieving revision 1.6
diff -u -a -r1.6 ini.xml
--- reference/apc/ini.xml       12 Mar 2006 02:16:54 -0000      1.6
+++ reference/apc/ini.xml       8 Jun 2006 02:41:25 -0000
@@ -47,7 +47,7 @@
-      <entry>PHP_INI_ALL</entry>
+      <entry>PHP_INI_SYSTEM</entry>


Index: php_apc.c
RCS file: /repository/pecl/apc/php_apc.c,v
retrieving revision 3.98
diff -u -a -r3.98 php_apc.c
--- php_apc.c   7 Jun 2006 18:35:28 -0000       3.98
+++ php_apc.c   8 Jun 2006 02:42:20 -0000
@@ -136,7 +136,7 @@

-STD_PHP_INI_BOOLEAN("apc.enabled",      "1",    PHP_INI_ALL, OnUpdateBool,              enabled,         zend_apc_globals, apc_globals)
+STD_PHP_INI_BOOLEAN("apc.enabled",      "1",    PHP_INI_SYSTEM, OnUpdateBool,              enabled,         zend_apc_globals, apc_globals)
 STD_PHP_INI_ENTRY("apc.shm_segments",   "1",    PHP_INI_SYSTEM, OnUpdateInt,            shm_segments,    zend_apc_globals, apc_globals)
 STD_PHP_INI_ENTRY("apc.shm_size",       "30",   PHP_INI_SYSTEM, OnUpdateInt,            shm_size,        zend_apc_globals, apc_globals)
 STD_PHP_INI_BOOLEAN("apc.optimization", "0",    PHP_INI_ALL, OnUpdateInt,               optimization,    zend_apc_globals, apc_globals)

I assume this cna be changeable in httpd.conf at least right ?
 [2006-12-11 00:17 UTC]
This has been corrected in CVS so that the apc.enabled is INI_SYSTEM.  To allow per directory configuration the apc.cache_by_default setting has been changed to INI_ALL.  Thanks.
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Aug 12 01:01:25 2020 UTC