こんにちは、松本です。
熱かったり寒かったり 中々でありますが、いかがお過ごしでしょうか。
TwitPepper(ツイットペッパー)の解説も完結しない中、perl案件をこなしつつ、PHPで動的にJSを書いていると中々なカオスであります。
PHP5.3.2のリリース に伴い、早速にアップグレードしまして メモがてらインストールログです。
configure
configureは CentOS5.3 で PHP5.3をインストール(YUM風オプションで) に倣いまして、yum風な設定にしています。
x86_64(64ビット)
以下をコピペしてお使い下さい
./configure –with-apxs2=/usr/sbin/apxs –build=x86_64-redhat-linux-gnu –host=x86_64-redhat-linux-gnu –target=x86_64-redhat-linux-gnu –program-prefix= –prefix=/usr –exec-prefix=/usr –bindir=/usr/bin –sbindir=/usr/sbin –sysconfdir=/etc –datadir=/usr/share –includedir=/usr/include –libdir=/usr/lib64 –libexecdir=/usr/libexec –localstatedir=/var –sharedstatedir=/usr/com –mandir=/usr/share/man –infodir=/usr/share/info –cache-file=../config.cache –with-libdir=lib64 –with-config-file-path=/etc –with-config-file-scan-dir=/etc/php.d –with-pic –with-bz2 –with-curl –with-exec-dir=/usr/bin –with-freetype-dir=/usr –with-png-dir=/usr –enable-gd-native-ttf –with-gettext –with-gmp –with-iconv –with-jpeg-dir=/usr –with-openssl –with-pcre-regex=/usr –with-zlib –with-layout=GNU –enable-exif –enable-ftp –enable-magic-quotes –enable-sockets –enable-sysvsem –enable-sysvshm –enable-sysvmsg –enable-wddx –enable-ucd-snmp-hack –enable-shmop –enable-calendar –with-libxml-dir=/usr –enable-pcntl –enable-mbstring –enable-mbregex –with-gd=shared –enable-bcmath=shared –enable-dba=shared –with-db4=/usr –with-xmlrpc=shared –with-mysql=/var/lib/mysql –with-mysql-sock=/var/lib/mysql/mysql.sock –with-mysqli=shared,/usr/bin/mysql_config –enable-dom=shared –enable-soap=shared –with-xsl=shared,/usr –enable-xmlreader=shared –enable-xmlwriter=shared –with-pdo-mysql=shared,/usr –enable-zip –enable-zend-multibyte –with-mcrypt
i386(32ビット)
以下をコピペしてお使い下さい
./configure –with-apxs2=/usr/sbin/apxs –build=i386-redhat-linux-gnu –host=i386-redhat-linux-gnu –target=i386-redhat-linux-gnu –program-prefix= –prefix=/usr –exec-prefix=/usr –bindir=/usr/bin –sbindir=/usr/sbin –sysconfdir=/etc –datadir=/usr/share –includedir=/usr/include –libdir=/usr/lib –libexecdir=/usr/libexec –localstatedir=/var –sharedstatedir=/usr/com –mandir=/usr/share/man –infodir=/usr/share/info –cache-file=../config.cache –with-libdir=lib –with-config-file-path=/etc –with-config-file-scan-dir=/etc/php.d –with-pic –with-bz2 –with-curl –with-exec-dir=/usr/bin –with-freetype-dir=/usr –with-png-dir=/usr –enable-gd-native-ttf –with-gettext –with-gmp –with-iconv –with-jpeg-dir=/usr –with-openssl –with-pcre-regex=/usr –with-zlib –with-layout=GNU –enable-exif –enable-ftp –enable-magic-quotes –enable-sockets –enable-sysvsem –enable-sysvshm –enable-sysvmsg –enable-wddx –enable-ucd-snmp-hack –enable-shmop –enable-calendar –with-libxml-dir=/usr –enable-pcntl –enable-mbstring –enable-mbregex –with-gd=shared –enable-bcmath=shared –enable-dba=shared –with-db4=/usr –with-xmlrpc=shared –with-mysql=/var/lib/mysql –with-mysql-sock=/var/lib/mysql/mysql.sock –with-mysqli=shared,/usr/bin/mysql_config –enable-dom=shared –enable-soap=shared –with-xsl=shared,/usr –enable-xmlreader=shared –enable-xmlwriter=shared –with-pdo-mysql=shared,/usr –enable-zip –enable-zend-multibyte –with-mcrypt –enable-mbstring
インストール
sudo make install
以下のコマンドでPHPのバージョンが"5.3.2"と表示されればOKです。
$ php -v PHP 5.3.2 (cli) (built: Mar 6 2010 20:49:38) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
httpd を再起動してPHPを読み込み直します。
# service httpd restart
eAcceleratorをインストール
eAccelerator をデフォルトで利用しています。
こちらも make し直して、新規にインストールします。
cd /usr/local/src wget http://bart.eaccelerator.net/source/0.9.6/eaccelerator-0.9.6.tar.bz2 tar jvxf eaccelerator-0.9.6.tar.bz2 cd eaccelerator-0.9.6 phpize ./configure --enable-eaccelerator=shared export SED=sed sudo make sudo make install
php.ini に記述追加
※zend_extension は eaccelerator.so のインストール先を指定します。
※eaccelerator.cache_dir の指定先ディレクトリは予め作成しておきます。
[eaccelerator] zend_extension="/usr/lib/20090626/eaccelerator.so" eaccelerator.shm_size = "32" eaccelerator.cache_dir = "/var/php-cache/eaccelerator" eaccelerator.enable = "1" eaccelerator.optimizer = "1" eaccelerator.check_mtime = "1" eaccelerator.debug = "0" eaccelerator.filter = "" eaccelerator.shm_max = "0" eaccelerator.shm_ttl = "86400" 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"
phpのバージョンを再度確認
以下のコマンドでPHPのバージョンが"5.3.2"と表示され、eAccelerator がその下に記述されていればOKです。
$ php -v PHP 5.3.2 (cli) (built: Mar 6 2010 20:49:38) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies with eAccelerator v0.9.6, Copyright (c) 2004-2010 eAccelerator, by eAccelerator
eAccelerator を使う環境で VirtualHost をする
eAccelerator を使う環境で VirtualHost をする場合、httpd.conf の 同 VirtualHost 内の セクションに以下を記述します。
name_space 名は、他と重複しなければ何でも良いです
php_value eaccelerator.name_space "project_name"
メモがてら程度の簡単なログですがお役に立てますと幸いです。
関連リンク
- PHP本家
- eAccelerator本家 ※0.9.6 がリリースされています。








