安装/配置
在线手册:中文 英文
PHP手册

安装

» PECL 扩展未与 PHP 捆绑。

安装此 PECL 扩展相关的信息可在手册中标题为 PECL 扩展的安装 章节中找到。另外的信息,如新的发行版本、下载、源文件、 Additional information such as new releases,维护人员信息及变更日志等,都在此处: » http://pecl.php.net/package/apc.

PECL 扩展的 DLL 当前不可用。参见 在 Windows 上构建 章节。

Note: 在Windows上,APC需要一个临时目录,并且Web服务器对这个目录可写,APC会检测TMP,TEMP,USERPROFILE这些Windows的环境变量,如果这些都没有,会检查系统文件夹下的WINDOWS目录。

Note: 更深层次,更高级别的技术实现细节,请参阅 »  开发人员提供的 TECHNOTES 文件 .


安装/配置
在线手册:中文 英文
PHP手册
PHP手册 - N: 安装

用户评论:

Anonymous (24-Jan-2012 08:16)

On my Debian Squeeze 64-bit I also had to install the package "apache2-threaded-dev" with this command "apt-get install apache2-threaded-dev". Afterwards I did "pecl install apc" and everything seemed to work fine.

scarywound at gmail com (22-Nov-2011 08:45)

Pay attention to the fact that installing php-apc package gives you APC version 3.1.3p1, which is according to http://pecl.php.net/package/APC UNSTABLE. If you want the latest STABLE edition (3.1.9 by now), you should use 'sudo pecl install apc' instead.

brian at diamondsea dot com (18-Jun-2011 03:34)

When installing on Plesk and cPanel machines, I get the following error message:

[root@web1 ~]# pecl install apc
downloading APC-3.1.9.tgz ...
Starting to download APC-3.1.9.tgz (155,540 bytes)
.................................done: 155,540 bytes
54 source files, building
running: phpize
Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20060613
Zend Extension Api No:   220060519
/usr/bin/phpize: /tmp/pear/temp/APC/build/shtool: /bin/sh: bad interpreter: Permission denied
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.

ERROR: `phpize' failed

The problem is caused by the /tmp/ filesystem being mounted noexec, which keeps any programs on /tmp/ from being allowed to be executed, which breaks the install script. 

To remount /tmp/ as executable, use:

[root@web1 ~]# mount -o remount,exec,suid /tmp

The it should install correctly.

After the install is done, remount the /tmp/ filesystem with the noexec permissions reset.

[root@web1 ~]# mount -o remount,noexec,nosuid /tmp

pr at outwit dot com (15-Aug-2009 10:11)

Installed successfully on different FreeBSD servers, with mmap and IPC semaphores, but I got an error on a 64 bits box :

apc_sem_create: semctl(65536,...) failed: Result too large

I had to increase maximum semaphore value :

# sysctl kern.ipc.semvmx=131068
kern.ipc.semvmx: 32767 -> 131068
# echo "kern.ipc.semvmx=131068" >>  /etc/sysctl.conf

Works like a charm.

toby at telegraphics dot com dot au (04-Apr-2009 06:04)

On Gentoo,

# emerge pecl-apc

Check installation:

 $ php -r 'phpinfo();' |grep apc
additional .ini files parsed => /etc/php/cli-php5/ext-active/apc.ini,
apc
apc.cache_by_default => On => On
apc.coredump_unmap => Off => Off
apc.enable_cli => Off => Off
apc.enabled => On => On
apc.file_update_protection => 2 => 2
apc.filters => no value => no value
apc.gc_ttl => 3600 => 3600
apc.include_once_override => Off => Off
apc.max_file_size => 1M => 1M
apc.num_files_hint => 1024 => 1024
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.shm_segments => 1 => 1
apc.shm_size => 30 => 30
apc.slam_defense => 0 => 0
apc.stat => On => On
apc.stat_ctime => Off => Off
apc.ttl => 7200 => 7200
apc.user_entries_hint => 4096 => 4096
apc.user_ttl => 7200 => 7200
apc.write_lock => On => On
suhosin.apc_bug_workaround => Off => Off

61924 dot 00 at gmail dot com (11-Dec-2008 06:23)

sudo apt-get install php-apc
sudo /etc/init.d/apache2 restart

Was enough for me. I use Ubuntu Server 8.10.

Anonymous (25-Jul-2008 11:18)

On Ubuntu I had to install the apache2-threaded-dev package.  It's the the Etch repos.

consistency (23-Jul-2008 09:07)

debian etch installation

apt-get install apache2
apt-get install libapache2-mod-php5
apt-get install php-pear
apt-get install php5-dev
apt-get install make
apt-get install apache2-prefork-dev
pecl install apc

apache2-prefork-dev is necessary for not having the
"Sorry, I was not able to successfully run APXS."
error