CentOS 6버전에서 nginx php-fpm mysql을 yum으로 설치해보았습니다.
설치시 셋팅되는 버전은 아래와 같습니다.
설치 OS : CentOS 6.8 64bit
셋팅 되는 버전
nginx – 1.10.2
MySQL – 5.1.73
PHP(fpm-fcgi) – 5.3.3
PHP_Zendoptimizer – 2.3.0


# 기본적인 라이브러리를 설치합니다.
yum -y install zlib libpng freetype gd gcc g++


# mysql를 설치합니다.
yum -y install mysql*



# php 설치시 php-fpm이 설치되며 httpd도 같이 설치됩니다. 하지만 이부분은 httpd를 사용하지 않을것이기 때문에
크게 걱정하지 않아도 됩니다.
크게 걱정하지 않아도 됩니다.
yum install php*

# yum으로 nginx를 설치하기위해 먼저 아래의 파일을 설치합니다.
rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm

# nginx를 설치합니다.
yum install nginx



# 설치 완료후에 php-fpm의 설정부분에서 user하고 group가 apache로 되어있는걸 알수있습니다.
그것을 확인후 nginx로 번경하고 chdir를 검색하여 nginx의 기본 디렉토리를 지정해줍니다.
vi /etc/php-fpm.d/www.conf
# 유저 및 그룹 변경
user = nginx
group = nginx
# nginx 기본 디렉토리 지정
chdir = /usr/share/nginx/html


# php-fpm과 nginx의 연동을 위해 설정을 변경합니다. 먼저 index에 index.php를 추가해줍니다.
# /etc/nginx/conf.d/default.conf 설정
location / {
root /usr/share/nginx/html;
index index.html index.htm index.php;
}


# 그 다음은 pass the PHP에 관련된 부분으로 이동하셔서 주석처리가 된 부분을 아래과 같이 수정해줍니다.
location ~ \.php$ {
# root html;
root /usr/share/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

# 리부팅되면 자동적으로 서비스가 올라오도록 설정해줍니다.
chkconfig –level 3 mysqld on
chkconfig –level 3 mysqld nginx
chkconfig –level 3 php-fpm on
chkconfig –list |grep mysql
chkconfig –list |grep nginx
chkconfig –list |grep php-fpm

# 아래의 부분으로 이동하여 session의 apache를 nginx로 변경합니다. 변경하지 않고 이용시
php를 정상적으로 이용하기 어렵습니다.
ls -la /var/lib/php
합계 12
drwxr-xr-x 3 root root 4096 2016-11-04 16:27 .
drwxr-xr-x. 30 root root 4096 2016-11-04 16:27 ..
drwxrwx— 2 root apache 4096 2016-08-12 05:36 session
chown root.nginx session

# /usr/share/nginx/html/에 이동후 기존에 있는 index.html을 잠시 다른 이름으로 변경하고
phpinfo의 기입된 index.php를 생성 합니다.
cd /usr/share/nginx/html
mv index.html backup_index.html
echo “<?php phpinfo(); ?>” >> /usr/share/nginx/html/index.php

# 서비스를 구동합니다.
service nginx start
service php-fpm start
service mysqld start

# 80번 포트 3306포트등이 정상적으로 올라왔는지 체크합니다.

# nginx +mysql + php-fpm 설치가 모두 완료되었습니다.