[餅] 餅空 blog / Nucleus支店

前の記事: PHPデバッグ機能付きエディタ Peggy Pro for PHP
次の記事: 某専用サーバのRHEL3

2007-03-05

APC導入でPHPを高速化

PHP4.4.6にしてから、なぜか時々Pukiwikiが白紙ページを吐くようになったので、PHP Acceleratorを外したら解決しました。サーバの環境の問題だろうか?よくわからないなー。

んで、APCを入れてみる事にしました。PHPはソースから入れてます。

参考にしたページ
PECL :: Package :: APC
ほよログ新館 APCを導入して高速化する

早速スタートです。
# pear channel-update pecl.php.net
# pear install pecl/APC

どんどん進んだけど、apxsが見つからないと怒られてしまった。
Sorry, I was not able to successfully run APXS. Possible reasons:

1. Perl is not installed;
2. Apache was not compiled with DSO support (--enable-module=so);
3. 'apxs' is not in your path. Try to use --with-apxs=/path/to/apxs
The output of apxs follows
/tmp/pear/cache/APC-3.0.13/configure: line 2995: apxs: command not found
configure: error: Aborting
ERROR: `/tmp/pear/cache/APC-3.0.13/configure --with-apxs' failed

確かに /usr/local/apache2/binにパスは通ってないもんな。
# PATH=$PATH:/usr/local/apache2/bin/

再度スタートです。
# pear install pecl/APC

ズンズンズン
Starting to download APC-3.0.13.tgz (105,042 bytes)
........................done: 105,042 bytes
40 source files, building
running: phpize
Configuring for:
PHP Api Version: 20020918
Zend Module Api No: 20020429
Zend Extension Api No: 20050606
1. Use apxs to set compile flags (if using APC with Apache)? : yes
(中略)
Build process completed successfully
Installing '/usr/local/lib/php/extensions/no-debug-non-zts-20020429/apc.so'
install ok: channel://pecl.php.net/APC-3.0.13
configuration option "php_ini" is not set to php.ini location
You should add "extension=apc.so" to php.ini

成功したようなので、php.iniを書き換えます。apc.soが変なところに入っていたのでフルパスで指定しました。extension_dirを使用しました。
extension_dir=/usr/local/lib/php/extensions/no-debug-non-zts-20020429/
extension=apc.so
apc.enabled = 1
apc.mmap_file_mask = /tmp/apc.XXXXXX

phpinfo()で確認。大丈夫のようです。

posted at 11:44:54 on 2007-03-05 by mochy - Category: コンピュータ

Amazon

Comments

vyv00411 wrote:

apcどんな感じですか?
パフォーマンスはアップしたでしょうか?
自前のWordpressにLAN上のマシンからabで計測した限りでは、使用前:使用後で1.2〜1.5倍以上アップしました。
2007-03-30 10:35:58

mochy wrote:

実は他のアクセラレータで若干問題が発生したため入れ替える事になったので、ベンチマークはとってませんでした。
2007-04-07 00:23:21

Add Comments



TrackBack

Trackback
There are currently no trackbacks for this item.
Use this TrackBack url to ping this item (right-click, copy link target). If your blog does not support Trackbacks you can manually add your trackback by using this form.

前後の記事

前の記事: PHPデバッグ機能付きエディタ Peggy Pro for PHP
次の記事: 某専用サーバのRHEL3

MyMiniCity

MyMiniCity

死語ステッカー

死語ブログパーツ

著作権保護期間延長反対

著作権保護期間の延長反対

PR

NEC「得選街」PCサーバ 半額以下キャンペーン実施中

ザッピング

あわせて読みたい

あわせて読みたい

TEAM -6%

今年もクールビズ

Blog Scouter