phpを高速化させるapcをインストールしようと思いやってみたのですが、
エラーではまってしまったので内容を備忘録の為に残しておく。
まずは、peclでインストール出来るということだったので
単純に下記のコマンドを入力。するとエラーが。。。
# pecl install apc downloading APC-3.0.16.tgz ... Starting to download APC-3.0.16.tgz (114,298 bytes) .............done: 114,298 bytes 45 source files, building running: phpize Configuring for: PHP Api Version: 20041225 Zend Module Api No: 20060613 Zend Extension Api No: 220060519 1. Use apxs to set compile flags (if using APC with Apache)? : yes 1-1, 'all', 'abort', or Enter to continue: building in /var/tmp/pear-build-root/APC-3.0.16 running: /var/tmp/APC/configure --with-apxs checking for egrep... grep -E checking for a sed that does not truncate output... /bin/sed checking for gcc... no checking for cc... no checking for cc... no checking for cl... no configure: error: no acceptable C compiler found in $PATH See `config.log' for more details. ERROR: `/var/tmp/APC/configure --with-apxs' failed
何やら、Cコンパイラが無いとの事。
これに気付くのに凄く時間が掛ってしまった。。。
コンパイラが無いとの事なので、早速yumでインストール
# yum install gcc # yum install gcc-c++
で、もう一度peclコマンドを入力
# pecl install apc Build process completed successfully Installing '/usr/lib/php/modules/apc.so' install ok: channel://pecl.php.net/APC-3.0.16 configuration option "php_ini" is not set to php.ini location You should add "extension=apc.so" to php.ini
すると今度は無事にインストール出来ました^^
でも、まだiniファイルを作らなきゃダメみたいなので
apc.iniファイルを新規追加。
# vi /etc/php.d/apc.ini extension=apc.so
次に、apacheの再起動
# /etc/init.d/httpd restart httpd を停止中: [ OK ] httpd を起動中: [ OK ]
最後に、phpinfo()で[apc]の項目があれば完了!!