我安装并启用了 APC,在我的 apache2/php5 站点上完美运行。
但是,它不能直接在 shell 中工作。
我创建了一个 test.php:
<?php
apc_store('test', 'apc works!');
echo apc_fetch('test');
echo "\n";
echo 'Script works!';
echo "\n";
?>
这是输出:
rimmer:/home# /usr/bin/php5 -f test.php
Script works!
提供更多信息:
rimmer:/home# cat /etc/php5/cli/conf.d/apc.ini
extension=apc.so
apc.enabled=1
apc.cache_by_default=1
apc.max_file_size=32M
知道我在这里做错了什么吗?
编辑
rimmer:~# php --ini
Configuration File (php.ini) Path: /etc/php5/cli
Loaded Configuration File: /etc/php5/cli/php.ini
Scan for additional .ini files in: /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/imap.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_pgsql.ini,
/etc/php5/cli/conf.d/pgsql.ini