FreeBSD/eAccelerator の変更点
#contents
*eAccelerator で PHP 高速化 [#oee42695]
&color(Red){※CGI版のPHPでeAcceleratorを使用することはできません。};
((参考にしていただいたページ[[PHP:eAcceleratorで PHP 高速化 php.y-110's Wiki>http://php.y-110.net/wiki/index.php?PHP%A1%A7eAccelerator%20%A4%C7%20PHP%20%B9%E2%C2%AE%B2%BD#z2d2b582]]))
※&color(red){PHP本体を再インストールした場合、eacceleratorも再コンパイル⇒インストールしないとApacheが起動できないのでバージョンアップの際は注意が必要。};
**環境 [#n56fd0bd]
-FreeBSD 6.1-RELEASE
-PHP 4.4.4
-Apache/2.0.59
-eaccelerator-0.9.5
**ダウンロード [#y44b90c9]
[[SourceForge:eAccelerator>http://sourceforge.net/project/showfiles.php?group_id=122249]]
↑から最新版をダウンロードします。
**インストール [#l465bfe9]
# tar jxvf eaccelerator-0.9.5.tar.bz2
# cd eaccelerator-0.9.5
# phpize
# ./configure --enable-eaccelerator=shared --with-php-config=/usr/local/bin/php-config
# make && make install
キャッシュコントロール用のcontrol.phpを公開ディレクトリに移動。
# cp control.php 公開ディレクトリ
***&color(red){※phpizeでエラーが出る場合}; [#b284ca7f]
私の環境だと、phpize実行時に「Cannot find autoconf」のようなエラーで止まってしまっておりました。
$ phpize
Configuring for:
PHP Api Version: 20020918
Zend Module Api No: 20020429
Zend Extension Api No: 20050606
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF
environment variable is set correctly and then rerun this script.
■対処
-autoconfがインストールされていない場合は、インストールする。
-下記のようにシンボリックリンクを貼ってみる
# ln -s /usr/local/bin/autoconf259 /usr/local/bin/autoconf
# ln -s /usr/local/bin/autheader259 /usr/local/bin/autoheader
**php.ini に eAccelerator の設定項目を追加 [#gd12d37c]
[eaccelerator]
zend_extension="/usr/local/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so"
eaccelerator.shm_size = "32"
eaccelerator.cache_dir="/var/tmp/eaccelerator"
eaccelerator.enable = "1"
eaccelerator.optimizer = "1"
eaccelerator.check_mtime = "1"
eaccelerator.debug = "0"
eaccelerator.filter = ""
eaccelerator.shm_max = "0"
eaccelerator.shm_ttl = "0"
eaccelerator.shm_prune_period = "0"
eaccelerator.shm_only = "0"
eaccelerator.compress = "1"
eaccelerator.compress_level = "9"
eaccelerator.keys = "shm_and_disk"
eaccelerator.sessions = "shm_and_disk"
eaccelerator.content = "shm_and_disk"
eaccelerator.allowed_admin_path = "/home/matsui/public_html/control.php"
eaccelerator.allowed_admin_path = "/コピーしたパス/control.php"
**Apacheの再起動 [#o0311150]
# apachectl restart
**動作確認 [#cf0e9882]
-php -v
root@vaio# php -v
PHP 4.4.4 (cli) (built: Sep 3 2006 01:10:59)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
with eAccelerator v0.9.5, Copyright (c) 2004-2006 eAccelerator, by eAccelerator
-phpinfo()
&ref(http://ma21.ath.cx/images/eaccelerator/eaccelerator01.jpg);