PHP高速化
- CentOS 5.4
PHPを高速化するAPC(Alternative PHP Cache)を導入すると高速化に繋がる。
1.php-pearインストール
・peclコマンドを使用してAPCを導入するため。
[root@yunspire src]# yum install php-pear
2.httpd-develインストール
・APCをApache用として使用する場合はapxsがインストールされている必要があり、
apxsはhttpd-develパッケージに含まれる。
[root@yunspire src]# yum install httpd-devel
3.ビルド環境を導入
・phpizeが必要となる。またgccも導入する。
[root@yunspire src]# yum install php-devel gcc
4。APCインストール
[root@yunspire src]# pecl install APC downloading APC-3.0.19.tgz ... Starting to download APC-3.0.19.tgz (115,735 bytes) .................done: 115,735 bytes 47 source files, building ...
5.php.iniを修正する
・APCを使用するために、末尾に下記を追加する
[root@yunspire src]# vi /etc/php.ini extension=apc.so <|| 6.Apacheリスタート ・APCを有効にする >|| [root@yunspire src]# service httpd restart