CentOS 5.5 + PHP 5.3.3 + PHP-FPM + APC + nginx (yum RPMs)を参考に
EPEL、IUS-Communityレポジトリを追加
# wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5.5/x86_64/epel-release-1-1.ius.el5.noarch.rpm
# wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5.5/x86_64/ius-release-1.0-6.ius.el5.noarch.rpm
# rpm -ivh epel-release-1-1.ius.el5.noarch.rpm ius-release-1.0-6.ius.el5.noarch.rpm
IUS-Communityレポジトリのバーションが5なので5.5に変更
# vi /etc/yum.repos.d/ius.repo
mirrorlist=http://dmirr.iuscommunity.org/mirrorlist?repo=ius-el5&arch=$basearch をコメントアウトして、
baseurl=http://dl.iuscommunity.org/pub/ius/stable/Redhat/5.5/$basearch を追加
MySQLのインストール
5.1系
# yum install mysql51.x86_64 mysql51-devel.x86_64 mysql51-server.x86_64
5.5系
# yum install mysql55.x86_64 mysql55-devel.x86_64 mysql55-server.x86_64
PHP 5.3とPHP-FPMとAPCのインストール
# yum install php53u.x86_64 php53u-devel.x86_64 php53u-gd.x86_64 php53u-mbstring.x86_64 php53u-mcrypt.x86_64 php53u-mysql.x86_64 php53u-pdo.x86_64 php53u-pecl-imagick.x86_64 php53u-fpm.x86_64 php53u-pecl-apc.x86_64
その他のエクステンションは yum search php53u で
nginxのインストール
インストールされるバージョンは 0.8.53、0.7系をインストールしたい時は nginx07.x86_64 を指定
# yum install nginx.x86_64
nginxの設定ファイルを編集
# vi /etc/nginx/nginx.conf
#location ~ \.php$ { ブロックのコメントアウトを解除
さらに
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; を
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name; に変更
自動起動の設定
# chkconfig mysqld on
# chkconfig php-fpm on
# chkconfig nginx on
MySQL、PHP-FPM、nginxを起動
# service mysqld start
# service php-fpm start
# service nginx start