php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59730 doesn't cache files most of the time or when it does misses 100%
Submitted: 2011-04-22 18:48 UTC Modified: 2011-04-22 19:15 UTC
From: yml at yml dot com Assigned:
Status: Closed Package: APC (PECL)
PHP Version: 5.3.5 OS: Fedora Core 14
Private report: No CVE-ID: None
 [2011-04-22 18:48 UTC] yml at yml dot com
Description:
------------
Either does not cache the file in question (even after a touch) or if it does never registers a cache hit using current SVN version (2011-04-22) even after 100+ reloads of the test file in question.

Config:

extension=apc.so

apc.enabled=1
apc.shm_size=128M
apc.ttl=7200
apc.user_ttl=7200
apc.enable_cli=1

If apc.include_once_override is enabled all include_once() and require_once() silently fail and nothing is cached.

Restarting the apache webserver process has no effect. Touching or altering the underlying file sometimes causes it to be cached. (Shouldn't it recache everything once the server is restarted?)

Cached Files	0 ( 0.0 Bytes)
Hits	1
Misses	0
Request Rate (hits, misses)	1.00 cache requests/second
Hit Rate	1.00 cache requests/second
Miss Rate	0.00 cache requests/second
Insert Rate	1.00 cache requests/second
Cache full count	0

Loading apc.php reliably causes it to report a cache hit. However, the numbers do not change even after 100 reloads.

I am using the Fedora Core provided version of PHP 5.3.5 (modules/libphp5.so) with a custom built APC pulled from SVN today configured using ./configure --with-php-config=/usr/bin/php-config

All self-tests on the command line pass.

What is the correct place to ask questions about APC?

Reproduce code:
---------------
I am using this file for testing:

<?php

class APCTEST
{
var $test1;

function __construct()
{
$this->test1 = "hello";
}

function printTest()
{
print $this->test1;
}

}

$testvar = new APCTEST;
$testvar->printTest();

saved in test.php in the document root and then loaded in a web browser 100 or so times.


Expected result:
----------------
I would expect to see the apc.php script report that the file has been cached and on subsequent requests that it has been hit.  

Actual result:
--------------
Alternatively apc.php reports that the file has not been cached or on the very rare occasions that it does report it has been cached it never reports a hit. This is after hundreds of hits on the page. 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-04-22 19:15 UTC] yml at yml dot com
PEBKAC.

It would help if I noticed that eaccellerator was installed on this Fedora Core 14 development box and, apparently, was interfering with APC. My apologies for the bad report.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 23 13:01:31 2024 UTC