php.net |  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
 [2006-06-28 04:56 UTC] rasmus at nospam dot staff dot spray dot se
Description:
------------
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%)")

___________________________________________

Versions:

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:
---------------
<?
var_dump(apc_load_constants('strings'));
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

Patches

Pull Requests

History

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
bool(false)
_Not Defined_Hej

==request #2
bool(true)
Hej

Could you reconfirm with the latest apc release ?
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 12 17:01:31 2024 UTC