server yum install latest redis

2019.03.27 03:02

엘카 조회 수:1682

yum --enablerepo=remi install redis

redis                   x86_64                   5.0.4-1.el7.remi                   remi                   920 k

 

systemctl enable --now redis

 

 

vi /etc/redis.conf

maxmemory 256m

 

yum install php-redis

 

service redis start

 

service php-fpm restart

 

phpinfo 통해 redis 연동이 가능한지 확인

 

redis.PNG

 

php test code 작성.

<?php
$redis = new Redis();
$redis->connect('127.0.0.1', 6379);
$redis->set('test_key','test_value', 60);
$val = $redis->get('test_key');
if($val=='test_value') echo 'work!';
else echo 'error';
$redis->close();

 

따로 selinux 설정 건드려줘야 할 줄 알았는데 그런거 없음. (centos7)

 

 

 

 

세션 세팅. php-fpm 은 설정을 따로 덮어씌우고 있어서 php.ini 수정해봐야 소용이 없다.

덮어씌우는 김에 serialize_handler 설정도 함께

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

php_value[session.save_handler] = redis

php_value[session.save_path] = tcp://127.0.0.1:6379

php_value[session.serialize_handler] = igbinary

 

번호 제목 날짜 조회 수
81 검색엔진 등록 file 2010.05.12 142341
80 VPS (가상 호스팅) 비교 file 2010.05.12 62201
79 마인크래프트 조합법 1 file 2011.04.01 38374
78 CentOS 6 - Apache 2.4.1 컴파일 / 보안 설정 [1] 2012.04.15 30240
77 리눅스 계정 생성/변경 [67] 2011.04.02 29128
76 Linux Memory 사용량 file 2012.05.16 24984
75 CentOS 6 - MySQL 5.5 설치 [1] file 2012.04.15 21722
74 Lighttpd 설치 file 2010.05.11 20679
73 sAPM file 2010.05.12 20261
72 php + ssh2 file 2010.06.05 20199
71 Linux 설치시 파티션 관리 file 2012.05.12 19206
70 Zend Optimizer + eAccelerator + Suhosin file 2010.05.11 18249
69 MySQL 설치 file 2010.05.11 17280
68 CentOS 6.2 다운로드 / 설치 [1] file 2012.04.15 17029
67 Apache 설치 file 2010.05.11 16658
66 ssh 로그인 제한 2011.04.05 16470
65 리눅스 자동 시작 file 2010.05.21 15895
64 ftp file 2010.07.23 15443
63 솔라리스 mount options 2013.10.06 15323
62 PHP 설치 file 2010.05.11 15057