PHP-FPM の設定変更
# sed -i -e 's/listen = 127.0.0.1:9000/listen = \/var\/run\/php-fpm\/php-fpm.sock/' /etc/php-fpm.d/www.conf
# sed -i -e 's/;listen.owner = nobody/listen.owner = nginx/' /etc/php-fpm.d/www.conf
# sed -i -e 's/;listen.group = nobody/listen.group = nginx/' /etc/php-fpm.d/www.conf
nginx の設定変更
PHP-FPM + nginx インストール(CentOS 6)で作成したバーチャルホストに対して設定する。
# sed -i -e 's/fastcgi_pass 127.0.0.1:9000;/fastcgi_pass unix:\/var\/run\/php-fpm\/php-fpm.sock;/' /etc/nginx/sites-available/virtualhost.conf
PHP-FPM と nginx の再起動
# /etc/rc.d/init.d/php-fpm restart
# /etc/rc.d/init.d/nginx configtest
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
# /etc/rc.d/init.d/nginx restart
# ls -l /var/run/php-fpm/php-fpm.sock
srw-rw----. 1 nginx nginx 0 3月 16 08:15 2015 /var/run/php-fpm/php-fpm.sock
動作確認
# echo '<?php phpinfo();' > /usr/share/nginx/virtualhost/index.php
ブラウザで以下のURLにアクセスして、PHP情報が表示されることを確認する。
http://virtualhost.tatsunet.net/