|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57114 apc_load_constants not working
Submitted: 2006-06-28 04:56 UTC Modified: 2006-08-21 15:50 UTC
From: rasmus at nospam dot staff dot spray dot se Assigned: gopalv (profile)
Status: Not a bug Package: APC (PECL)
PHP Version: 5.1.2 OS: Debian 3.1 linux 686
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
22 - 14 = ?
Subscribe to this entry?

 [2006-06-28 04:56 UTC] rasmus at nospam dot staff dot spray dot se
apc_load_constants() always fail and constants are not being defined.

I've confirmed the data being saved by apc_define_constants() using apc.php, a script provided with the APC PECL package which shows user cache entries.

However, the data ("constants") are not being loaded, not even accessed (apc.php reports "Num Hits: 0 (0.00%)")



APC             3.0.10 (r3.84)
PHP             5.1.4-0.1
PHP API         20041225
PHP Extension   20050922
Zend Extension  220051025

APC runtime settings:

apc.cache_by_default       On
apc.enable_cli             Off
apc.enabled	               On 
apc.file_update_protection 2
apc.filters	               (no value)
apc.gc_ttl                 3600
apc.max_file_size          1M
apc.mmap_file_mask         (no value)
apc.num_files_hint         1000
apc.optimization           Off
apc.shm_segments           1
apc.shm_size               128
apc.slam_defense           Off
apc.stat                   On
apc.ttl                    0
apc.user_entries_hint      100
apc.user_ttl               0

Reproduce code:
if(!defined('HELLO')) {
  echo '_Not Defined_';
  $constants = array(
     'HELLO'  => 'Hej',
  apc_define_constants('strings', $constants);
echo HELLO;

Expected result:
First request:
  bool(false) _Not Defined_ Hej

Following requests:
  bool(true) Hej

Actual result:
First request:
  bool(false) _Not Defined_ Hej

Following requests:
  bool(false) _Not Defined_ Hej


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-21 15:50 UTC] gopalv82 at yahoo dot com
Tested with php 5.1.6-dev and APC 3.0.11 and works for me as expected.

==request #1
_Not Defined_Hej

==request #2

Could you reconfirm with the latest apc release ?
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 11:01:34 2024 UTC