CentOS 为 PHP 安装 APC

Alternative PHP Cache(APC)是 PHP 的一个免费公开的优化代码缓存。

它用来提供免费,公开并且强健的架构来缓存和优化 PHP 的中间代码。

主要是加速PHP。

首先需要安装一些必须的开发包。

使用下面的命令:[[email protected] ~]# yum install gcc httpd-devel php-pear服务器输出:[code][[email protected] ~]# yum install gcc httpd-devel php-pear
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile

  • atomic: www5.atomicorp.com
  • base: centos.mirror.facebook.net
  • extras: mirrors.kernel.org
  • updates: mirrors.sonic.net
    Setting up Install Process
    Package gcc-4.1.2-51.el5.i386 already installed and latest version
    Resolving Dependencies
    –> Running transaction check
    —> Package httpd-devel.i386 0:2.2.3-53.el5.centos.3 set to be updated
    –> Processing Dependency: apr-util-devel for package: httpd-devel
    –> Processing Dependency: apr-devel for package: httpd-devel
    —> Package php-pear.noarch 1:1.7.2-2.el5.art set to be updated
    –> Running transaction check
    —> Package apr-devel.i386 0:1.2.7-11.el5_6.5 set to be updated
    —> Package apr-util-devel.i386 0:1.2.7-11.el5_5.2 set to be updated
    –> Processing Dependency: openldap-devel for package: apr-util-devel
    –> Processing Dependency: db4-devel for package: apr-util-devel
    –> Processing Dependency: expat-devel for package: apr-util-devel
    –> Running transaction check
    —> Package db4-devel.i386 0:4.3.29-10.el5_5.2 set to be updated
    —> Package expat-devel.i386 0:1.95.8-8.3.el5_5.3 set to be updated
    —> Package openldap-devel.i386 0:2.3.43-12.el5_7.10 set to be updated
    –> Processing Dependency: openldap = 2.3.43-12.el5_7.10 for package: openldap-devel
    –> Processing Dependency: cyrus-sasl-devel >= 2.1 for package: openldap-devel
    –> Running transaction check
    —> Package cyrus-sasl-devel.i386 0:2.1.22-5.el5_4.3 set to be updated
    —> Package openldap.i386 0:2.3.43-12.el5_7.10 set to be updated
    –> Finished Dependency Resolution

Dependencies Resolved

=================================================================================
Package Arch Version Repository Size

Installing:
httpd-devel i386 2.2.3-53.el5.centos.3 updates 151 k
php-pear noarch 1:1.7.2-2.el5.art atomic 420 k
Installing for dependencies:
apr-devel i386 1.2.7-11.el5_6.5 base 233 k
apr-util-devel i386 1.2.7-11.el5_5.2 base 53 k
cyrus-sasl-devel i386 2.1.22-5.el5_4.3 base 1.4 M
db4-devel i386 4.3.29-10.el5_5.2 base 1.9 M
expat-devel i386 1.95.8-8.3.el5_5.3 base 132 k
openldap-devel i386 2.3.43-12.el5_7.10 updates 1.5 M
Updating for dependencies:
openldap i386 2.3.43-12.el5_7.10 updates 297 k

Transaction Summary

Install 8 Package(s)
Upgrade 1 Package(s)

Total download size: 6.1 M
Is this ok [y/N]: y
Downloading Packages:
(1/9): apr-util-devel-1.2.7-11.el5_5.2.i386.rpm | 53 kB 00:00
(2/9): expat-devel-1.95.8-8.3.el5_5.3.i386.rpm | 132 kB 00:00
(3/9): httpd-devel-2.2.3-53.el5.centos.3.i386.rpm | 151 kB 00:00
(4/9): apr-devel-1.2.7-11.el5_6.5.i386.rpm | 233 kB 00:00
(5/9): openldap-2.3.43-12.el5_7.10.i386.rpm | 297 kB 00:00
(6/9): php-pear-1.7.2-2.el5.art.noarch.rpm | 420 kB 00:00
(7/9): cyrus-sasl-devel-2.1.22-5.el5_4.3.i386.rpm | 1.4 MB 00:01
(8/9): openldap-devel-2.3.43-12.el5_7.10.i386.rpm | 1.5 MB 00:01
(9/9): db4-devel-4.3.29-10.el5_5.2.i386.rpm | 1.9 MB 00:01

Total 842 kB/s | 6.1 MB 00:07
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : openldap 1/10
Installing : cyrus-sasl-devel 2/10
Installing : apr-devel 3/10
Installing : openldap-devel 4/10
Installing : expat-devel 5/10
Installing : db4-devel 6/10
Installing : apr-util-devel 7/10
Installing : php-pear 8/10
Installing : httpd-devel 9/10
Cleanup : openldap 10/10

Installed:
httpd-devel.i386 0:2.2.3-53.el5.centos.3 php-pear.noarch 1:1.7.2-2.el5.art

Dependency Installed:
apr-devel.i386 0:1.2.7-11.el5_6.5
apr-util-devel.i386 0:1.2.7-11.el5_5.2
cyrus-sasl-devel.i386 0:2.1.22-5.el5_4.3
db4-devel.i386 0:4.3.29-10.el5_5.2
expat-devel.i386 0:1.95.8-8.3.el5_5.3
openldap-devel.i386 0:2.3.43-12.el5_7.10

Dependency Updated:
openldap.i386 0:2.3.43-12.el5_7.10

Complete!
[[email protected] ~]# [/code]