dev/linux

[centos] install php 5.6

재삐신생 2015. 6. 29. 15:51
반응형

repository 추가 준비


CentOS 5

yum install epel-release

#혹은

wget --no-check-certificate https://dl.fedoraproject.org/pub/epel/epel-release-latest-5.noarch.rpm

sudo rpm -Uvh epel-release-latest-5.noarch.rpm


#Remi repository 추가

rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm


CentOS 6

yum install epel-release

#혹은

wget --no-check-certificate https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm

sudo rpm -Uvh epel-release-latest-6.noarch.rpm


#Remi repository 추가

rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm


설치

yum --enablerepo=remi,remi-php56 install php php-cli php-common php-fpm

#자주 쓰는 extention

yum --enablerepo=remi,remi-php56 install php-pdo php-mysqlnd php-mbstring php-mcrypt


fpm 설정

vi /etc/php-fpm.d/www.conf

[www]


listen = /var/run/php5-fpm.sock

listen.backlog = -1

listen.owner = nginx

listen.group = www-data

listen.mode = 0660


; Unix user/group of processes

user = nginx

group = www-data


; Choose how the process manager will control the number of child processes.

pm = dynamic

pm.max_children = 75

pm.start_servers = 10

pm.min_spare_servers = 5

pm.max_spare_servers = 20

pm.max_requests = 500


; Pass environment variables

env[HOSTNAME] = $HOSTNAME

env[PATH] = /usr/local/bin:/usr/bin:/bin

env[TMP] = /tmp

env[TMPDIR] = /tmp

env[TEMP] = /tmp



서비스 ON

chkconfig php-fpm on

#혹은

setup


기본세션 디렉토리 소유자 변경(php업데이트 시, 소유자가 변경됨)

chown nginx:www-data /var/lib/php/session -R

chown nginx:www-data /var/lib/php/wsdlcache -R


-> nginx기준

-> 2016.02.05 절대경로로 변경



=========================================================================================================


다른방법도 있다.

참고 : https://webtatic.com/packages/php56/


반응형