Все команды выполняются через CLI в системе Debian.
get_loaded_extensions () перечисляет "apc" и мои APC-настройки для CLI :
apc
APC Support => enabled
Version => 3.1.7
APC Debugging => Disabled
MMAP Support => Enabled
MMAP File Mask =>
Locking type => pthread mutex Locks
Serialization Support => php
Revision => $Revision: 307215 $
Build Date => Feb 27 2011 19:39:21
Directive => Local Value => Master Value
apc.cache_by_default => On => On
apc.canonicalize => On => On
apc.coredump_unmap => Off => Off
apc.enable_cli => On => On
apc.enabled => On => On
apc.file_md5 => Off => Off
apc.file_update_protection => 2 => 2
apc.filters => no value => no value
apc.gc_ttl => 3600 => 3600
apc.include_once_override => Off => Off
apc.lazy_classes => Off => Off
apc.lazy_functions => Off => Off
apc.max_file_size => 1M => 1M
apc.mmap_file_mask => no value => no value
apc.num_files_hint => 1000 => 1000
apc.preload_path => no value => no value
apc.report_autofilter => Off => Off
apc.rfc1867 => Off => Off
apc.rfc1867_freq => 0 => 0
apc.rfc1867_name => APC_UPLOAD_PROGRESS => APC_UPLOAD_PROGRESS
apc.rfc1867_prefix => upload_ => upload_
apc.rfc1867_ttl => 3600 => 3600
apc.serializer => default => default
apc.shm_segments => 1 => 1
apc.shm_size => 32M => 32M
apc.slam_defense => On => On
apc.stat => On => On
apc.stat_ctime => Off => Off
apc.ttl => 0 => 0
apc.use_request_time => On => On
apc.user_entries_hint => 4096 => 4096
apc.user_ttl => 0 => 0
apc.write_lock => On => On
очистить APC :
php -r "print_r(apc_clear_cache());"
дает "1".
выполнить очень простой PHP-файл"test.php":
php test.php
, но выполняется сейчас apc_cache_info ():
php -r "print_r(apc_cache_info());"
показывает нет кэшированных данных кажется:
Array
(
[num_slots] => 1031
[ttl] => 0
[num_hits] => 0
[num_misses] => 0
[num_inserts] => 0
[expunges] => 0
[start_time] => 1322733678
[mem_size] => 0
[num_entries] => 0
[file_upload_progress] => 1
[memory_type] => mmap
[locking_type] => pthread mutex Locks
[cache_list] => Array
(
)
[deleted_list] => Array
(
)
[slot_distribution] => Array
(
[0] => 0
[1] => 0
[2] => 0
[3] => 0
[4] => 0
[5] => 0
[6] => 0
[7] => 0
[8] => 0
[... ever value is 0 ... ]
почему это так?
Я хочу использовать APC в CLI, кэшировать код операции файла и затем «видеть», что что-то было кэшировано.
Дополнительная информация о системе и PHP :
phpinfo()
PHP Version => 5.3.8-1+b1
System => Linux debian 3.1.0-1-686-pae #1 SMP Tue Nov 29 19:01:56 UTC 2011 i686
Build Date => Nov 13 2011 10:54:57
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /etc/php5/cli
Loaded Configuration File => /etc/php5/cli/php.ini
Scan this dir for additional .ini files => /etc/php5/cli/conf.d
Additional .ini files parsed => /etc/php5/cli/conf.d/apc.ini,
/etc/php5/cli/conf.d/curl.ini,
/etc/php5/cli/conf.d/gd.ini,
/etc/php5/cli/conf.d/imagick.ini,
/etc/php5/cli/conf.d/intl.ini,
/etc/php5/cli/conf.d/mcrypt.ini,
/etc/php5/cli/conf.d/mysql.ini,
/etc/php5/cli/conf.d/mysqli.ini,
/etc/php5/cli/conf.d/pdo.ini,
/etc/php5/cli/conf.d/pdo_mysql.ini,
/etc/php5/cli/conf.d/pdo_sqlite.ini,
/etc/php5/cli/conf.d/sqlite.ini,
/etc/php5/cli/conf.d/sqlite3.ini,
/etc/php5/cli/conf.d/suhosin.ini,
/etc/php5/cli/conf.d/xdebug.ini
PHP API => 20090626
PHP Extension => 20090626
Zend Extension => 220090626
Zend Extension Build => API220090626,NTS
PHP Extension Build => API20090626,NTS
Debug Build => no
Thread Safety => disabled
Zend Memory Manager => enabled
Zend Multibyte Support => disabled
IPv6 Support => enabled