php.net |  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
Description:
------------
Hi:

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

php.ini  

extension=apc.so
apc.enabled=0
apc.shm_segments=1
apc.optimization=0
apc.shm_size=128
apc.ttl=7200
apc.user_ttl=7200
apc.num_files_hint=1024
apc.mmap_file_mask=/tmp/apc.XXXXXX
apc.enable_cli=0

then create an .htaccess file with :

php_flag apc.enabled On

OR

php_value apc.enabled 1

and try with

<?php 
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/kissofjudas.net/apc2.php on line 2 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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 @@
      <row>
       <entry>apc.enabled</entry>
       <entry>"1"</entry>
-      <entry>PHP_INI_ALL</entry>
+      <entry>PHP_INI_SYSTEM</entry>
       <entry></entry>
      </row>
      <row>

and 

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 @@
 #endif

 PHP_INI_BEGIN()
-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] shire@php.net
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-2019 The PHP Group
All rights reserved.
Last updated: Sun Dec 08 02:01:25 2019 UTC