php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59541 APC ignores non .inc or .php files
Submitted: 2010-12-18 01:05 UTC Modified: 2010-12-25 08:10 UTC
From: joanpc at gmail dot com Assigned:
Status: Closed Package: APC (PECL)
PHP Version: 5.2.13 OS: linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: joanpc at gmail dot com
New email:
PHP Version: OS:

 

 [2010-12-18 01:05 UTC] joanpc at gmail dot com
Description:
------------
I just updated apc to the last version and I found that is ignoring files without the .php .inc extension. I use apc on my Drupal websites that contain a lot of php files with the extension .module. There's a way to force include these files I tried specifying them on the apc.filters without success.

Thanks.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-18 01:08 UTC] rasmus@php.net
APC doesn't care about file extensions.  You must have 
something else going on with those files.  Any apc.filter 
lines in your config?
 [2010-12-18 02:15 UTC] joanpc at gmail dot com
nope, I'm using php-fpm with ngnix all was working great until the update. So weird.

I have just these options

apc.shm_size="96M"
apc.rfc1867 = "0"
apc.num_files_hint="1128"
apc.user_entries_hint="512"
apc.mmap_file_mask=/tmp/apc.XXXXXX
 [2010-12-18 16:27 UTC] joanpc at gmail dot com
I opened a discussion on 
http://groups.drupal.org/node/113594

It seems that the last correctly working version is APC-3.1.4

I also updated php to 5.2.16 with same results.
 [2010-12-18 18:46 UTC] rasmus@php.net
You need to look beyond the file extensions.  Like I said, 
there is nothing in APC that looks at the extension of a file.
 [2010-12-19 02:50 UTC] joanpc at gmail dot com
I think i found something

.module files are loaded dynamically by Drupal:
by  drupal_load() who gets the the full path of the file from an SQL table. And then calls include_once

http://api.drupal.org/api/drupal/includes--bootstrap.inc/function/drupal_load/6

.inc files are loaded almost in the same way:
module_load_include() who gets the path from SQL and adds the filename and extension usually form static string declarations.

http://api.drupal.org/api/drupal/includes--module.inc/function/module_load_include/6

neither of the two "inclusions" seems to get cached onto apc.

Only include files included directly from static declarations from other files like require_once 'includefile.inc' or  are cached. .modules files are never loaded in this way. For that reason I can't find any .module files on the apc cache.

Does this make more sense?
 [2010-12-24 17:54 UTC] pecl at mixologic dot com
Same issue. Just upgraded to 3.1.6, everything worked before 
the upgrade from 3.1.3.

I can confirm the behavior. Apparently apc doesnt want to 
cache dynamically included files:

This test:
<?php
$DYNAMIC_INCLUDE_ONCE = 'DYNAMIC_INCLUDE_ONCE.inc';
include_once 'INCLUDE_ONCE.inc';
include_once $DYNAMIC_INCLUDE_ONCE;

$DYNAMIC_REQUIRE_ONCE = 'DYNAMIC_REQUIRE_ONCE.inc';
require_once 'REQUIRE_ONCE.inc';
require_once $DYNAMIC_REQUIRE_ONCE;

?>

Results in only 3 of the four files being cached.
the 
include_once $DYNAMIC_INCLUDE_ONCE; 
Is failing to cache DYNAMIC_INCLUDE_ONCE.inc
 [2010-12-25 08:10 UTC] gopalv@php.net
apc.stat=0 rewrites all constant includes

so

include_once "foo.inc"

becomes 

include_once "/var/www/html/bar/foo.inc"

internally, while compilation happens. This does not happen
for dynamic includes. 

This issue with drupal < 7 has been reported and fixed 
already in svn (#20529).

Closing bug, please re-open if the svn trunk version fails.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 12:01:29 2024 UTC