server yum install latest redis

2019.03.27 03:02

엘카 조회 수:1694

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 142353
80 VPS (가상 호스팅) 비교 file 2010.05.12 62213
79 마인크래프트 조합법 1 file 2011.04.01 38420
78 CentOS 6 - Apache 2.4.1 컴파일 / 보안 설정 [1] 2012.04.15 30250
77 리눅스 계정 생성/변경 [67] 2011.04.02 29146
76 Linux Memory 사용량 file 2012.05.16 25024
75 CentOS 6 - MySQL 5.5 설치 [1] file 2012.04.15 21800
74 Lighttpd 설치 file 2010.05.11 20708
73 sAPM file 2010.05.12 20284
72 php + ssh2 file 2010.06.05 20230
71 Linux 설치시 파티션 관리 file 2012.05.12 19223
70 Zend Optimizer + eAccelerator + Suhosin file 2010.05.11 18267
69 MySQL 설치 file 2010.05.11 17295
68 CentOS 6.2 다운로드 / 설치 [1] file 2012.04.15 17046
67 Apache 설치 file 2010.05.11 16682
66 ssh 로그인 제한 2011.04.05 16481
65 리눅스 자동 시작 file 2010.05.21 15906
64 ftp file 2010.07.23 15468
63 솔라리스 mount options 2013.10.06 15337
62 PHP 설치 file 2010.05.11 15073