php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61486 mtime isn't get by apc
Submitted: 2012-03-23 06:39 UTC Modified: 2012-03-23 10:29 UTC
From: julien dot syx at stockho dot com Assigned:
Status: Not a bug Package: APC (PECL)
PHP Version: 5.3.10 OS: Solaris 10u8 (x86)
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: julien dot syx at stockho dot com
New email:
PHP Version: OS:

 

 [2012-03-23 06:39 UTC] julien dot syx at stockho dot com
Description:
------------
Hello,
I'm using php 5.3.10, here is my configure line :
CC': CC="/opt/solstudio12.2/bin/cc" CFLAGS="-xO4 " CXX="CC" CXXFLAGS="-xO4" 
./configure --prefix=/opt/ssi/php5 -disable-debug --disable-dmalloc --enable-
inline-optimization --disable-libgcc --disable-libtool-lock --disable-static --
enable-calendar=shared --enable-ctype=shared --enable-cli --enable-cgi --enable-
fastcgi --enable-dba=shared --enable-dbase=shared --enable-dom=shared --enable-
exif=shared --enable-force-cgi-redirect --enable-ftp=shared --enable-gd-jis-conv 
--enable-gd-native-ttf --enable-ipv6 --enable-libxml --enable-magic-quotes --
enable-mbregex --enable-mbstring=shared --enable-pcntl=shared --enable-
posix=shared --enable-reflection=shared --enable-safe-mode --enable-session --
enable-shared --enable-shmop=shared --enable-short-tags --enable-soap=shared --
enable-spl --enable-sysvmsg=shared --enable-sysvsem=shared --enable-
sysvshm=shared --enable-ucd-snmp-hack --enable-wddx=shared --enable-zend-
multibyte --enable-bcmath=shared --enable-sockets=shared --enable-hash --enable-
json=shared --enable-tokenizer=shared --with-xmlrpc=shared --enable-
xmlreader=shared --enable-xmlwriter=shared --enable-zip=shared --with-
bz2=shared,/usr --with-cdb --with-curl=shared,/opt/coolstack --with-curlwrappers 
--enable-flatfile --with-freetype-dir=/opt/coolstack --with-
gd=shared,/opt/coolstack --with-gdbm=/opt/coolstack --with-
gettext=shared,/opt/coolstack --with-gmp=shared,/opt/coolstack --with-
iconv=shared,/opt/coolstack --with-imap-ssl=shared,/opt/coolstack/imap --with-
imap=shared,/opt/coolstack/imap --enable-inifile --with-jpeg-dir=/opt/csw --with-
layout=PHP --with-libexpat-dir=/opt/coolstack/apache2 --with-libmbfl --with-
libxml-dir=/opt/coolstack --enable-mod-charset --with-
ncurses=shared,/opt/coolstack --with-ndbm=/usr --with-
openssl=shared,/opt/coolstack --with-pcre-dir=/opt/coolstack  --with-pear --with-
pgsql=shared,/usr --with-pic --with-png-dir=/usr --with-
readline=shared,/opt/coolstack --with-pspell=shared,/usr --with-
snmp=shared,/opt/coolstack --with-tidy=shared,/opt/coolstack --with-tsrm-pthreads 
--with-unixODBC=shared,/opt/coolstack --with-xmlrpc=shared --with-xpm-
dir=/usr/openwin --with-xsl=shared,/opt/coolstack --with-zend-vm=CALL --with-
zlib=shared,/usr --without-dbm --without-ndbm --without-t1lib --x-
includes=/usr/openwin/include --x-libraries=/usr/openwin/lib --with-
apxs2=/opt/coolstack/apache2/bin/apxs --with-mysql=mysqlnd --with-mysqli=mysqlnd 
--with-pdo-mysql=mysqlnd --with-config-file-path=/opt/ssi/php5/etc

I compiled APC 3.1.9 with this configure line :
CC="/opt/solstudio12.2/bin/cc" CFLAGS="-xO4" CXX="CC" CXXFLAGS="-xO4" ./configure 
--with-php-config=/opt/ssi/php5/bin/php-config --enable-apc-sem --with-
apxs=/opt/coolstack/apache2/bin/apxs

Here is the parameters of APC:
apc.enabled=1
apc.enable_cli=1
[apc]
apc.shm_segments=1
apc.optimization=0
apc.shm_size=128M
apc.ttl=60
apc.user_ttl=60
apc.gc_ttl=60
apc.stat=1
apc.stat_ctime=1
apc.num_files_hint=1024
apc.user_entries_hint=100
apc.mmap_file_mask=/dev/zero
apc.slam_defense=0

When I do an apc_cache_info() in cli,it works perfectly and displaying me he 
correct mtime. When I load this script via apache/libphp5.so, the mtime is 0, so 
APC acting like a apc.stat=0.

I'm on Solaris 10u8, ZFS filesystem. Every version of APC I tried produce the 
same bug.
I know this bug is similar : Bug #59085: APC not stating files correctly but 
sunsolve don't exists anymore and Oracle don't seems to understand my problem.

Expected result:
----------------
(
    [num_slots] => 1031
    [ttl] => 60
    [num_hits] => 14
    [num_misses] => 2
    [num_inserts] => 2
    [expunges] => 0
    [start_time] => 1332455520
    [mem_size] => 303440
    [num_entries] => 2
    [file_upload_progress] => 1
    [memory_type] => mmap
    [locking_type] => IPC Semaphore
    [cache_list] => Array
        (
            [0] => Array
                (
                    [type] => file
                    [device] => 47513615
                    [inode] => 8497
                    [filename] => /data/www/pp_stepone/pcl/apc.php
                    [num_hits] => 10
                    [mtime] => 0
                    [creation_time] => 1332455580
                    [deletion_time] => 0
                    [access_time] => 1332455755
                    [ref_count] => 0
                    [mem_size] => 299272
                )

Actual result:
--------------
(
    [num_slots] => 1031
    [ttl] => 60
    [num_hits] => 14
    [num_misses] => 2
    [num_inserts] => 2
    [expunges] => 0
    [start_time] => 1332455520
    [mem_size] => 303440
    [num_entries] => 2
    [file_upload_progress] => 1
    [memory_type] => mmap
    [locking_type] => IPC Semaphore
    [cache_list] => Array
        (
            [0] => Array
                (
                    [type] => file
                    [device] => 47513615
                    [inode] => 8497
                    [filename] => /data/www/pp_stepone/pcl/apc.php
                    [num_hits] => 10
                    [mtime] => 1332454100
                    [creation_time] => 1332455580
                    [deletion_time] => 0
                    [access_time] => 1332455755
                    [ref_count] => 0
                    [mem_size] => 299272
                )

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-03-23 06:46 UTC] rasmus@php.net
-Status: Open +Status: Not a bug
 [2012-03-23 06:46 UTC] rasmus@php.net
That's because you explicitly switched it to use ctime by having apc.stat_ctime=1 
in your config.
 [2012-03-23 07:17 UTC] julien dot syx at stockho dot com
I tried this option because even if i set apc.stats_ctime=0 mtime still the same 
(mtime=0)
 [2012-03-23 10:16 UTC] julien dot syx at stockho dot com
And I want to add : it doesn't want to work with ctime. As far as I know, ctime 
include file content change, even if there's a bug with mtime, it should work with 
ctime ?

But my question is why it works with CLI and doesn't work with Apache ? Is there 
any reason ?
 [2012-03-23 10:29 UTC] rasmus@php.net
No idea. This has only ever been reported on Solaris. APC doesn't do anything 
fancy here, It simply stats the file and looks at either the mtime or the ctime 
field in the resulting stat struct.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Oct 15 09:01:26 2024 UTC