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

 

번호 제목 날짜 조회 수
21 유닉스 계정 관리 2013.10.15 14650
20 PHP 설치 file 2010.05.11 15057
19 솔라리스 mount options 2013.10.06 15323
18 ftp file 2010.07.23 15443
17 리눅스 자동 시작 file 2010.05.21 15895
16 ssh 로그인 제한 2011.04.05 16470
15 Apache 설치 file 2010.05.11 16658
14 CentOS 6.2 다운로드 / 설치 [1] file 2012.04.15 17029
13 MySQL 설치 file 2010.05.11 17280
12 Zend Optimizer + eAccelerator + Suhosin file 2010.05.11 18249
11 Linux 설치시 파티션 관리 file 2012.05.12 19206
10 php + ssh2 file 2010.06.05 20200
9 sAPM file 2010.05.12 20261
8 Lighttpd 설치 file 2010.05.11 20679
7 CentOS 6 - MySQL 5.5 설치 [1] file 2012.04.15 21739
6 Linux Memory 사용량 file 2012.05.16 25005
5 리눅스 계정 생성/변경 [67] 2011.04.02 29129
4 CentOS 6 - Apache 2.4.1 컴파일 / 보안 설정 [1] 2012.04.15 30240
3 마인크래프트 조합법 1 file 2011.04.01 38377
2 VPS (가상 호스팅) 비교 file 2010.05.12 62201