server yum install latest redis

2019.03.27 03:02

엘카 조회 수:1660

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

 

번호 제목 날짜 조회 수
77 검색엔진 등록 file 2010.05.12 142338
76 VPS (가상 호스팅) 비교 file 2010.05.12 62197
75 마인크래프트 조합법 1 file 2011.04.01 37985
74 CentOS 6 - Apache 2.4.1 컴파일 / 보안 설정 [1] 2012.04.15 30219
73 리눅스 계정 생성/변경 [67] 2011.04.02 29116
72 Linux Memory 사용량 file 2012.05.16 24974
71 CentOS 6 - MySQL 5.5 설치 [1] file 2012.04.15 21686
70 Lighttpd 설치 file 2010.05.11 20675
69 sAPM file 2010.05.12 20246
68 php + ssh2 file 2010.06.05 20195
67 Linux 설치시 파티션 관리 file 2012.05.12 19197
66 Zend Optimizer + eAccelerator + Suhosin file 2010.05.11 18197
65 MySQL 설치 file 2010.05.11 17273
64 CentOS 6.2 다운로드 / 설치 [1] file 2012.04.15 17003
63 Apache 설치 file 2010.05.11 16653
62 ssh 로그인 제한 2011.04.05 16465
61 리눅스 자동 시작 file 2010.05.21 15888
60 ftp file 2010.07.23 15376
59 솔라리스 mount options 2013.10.06 15313
58 PHP 설치 file 2010.05.11 15053