server yum install latest redis

2019.03.27 03:02

엘카 조회 수:1830

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 MySQL 설치 file 2010.05.11 17452
80 Apache 설치 file 2010.05.11 16845
79 PHP 설치 file 2010.05.11 15259
78 Zend Optimizer + eAccelerator + Suhosin file 2010.05.11 18452
77 Lighttpd 설치 file 2010.05.11 20873
76 sAPM file 2010.05.12 20461
75 VPS (가상 호스팅) 비교 file 2010.05.12 62366
74 검색엔진 등록 file 2010.05.12 142494
73 html 파일에서 php 구문 숨기기 file 2010.05.17 7115
72 php 현재 시각 출력하기 file 2010.05.17 4725
71 php 암호화와 복호와 file 2010.05.17 7615
70 파일 불러오기 file 2010.05.17 5723
69 php 에서 텍스트 파일을 생성, 수정하기 file 2010.05.19 10181
68 php 쿠키 생성, 읽기 file 2010.05.19 7373
67 jQuery 쿠키 file 2010.05.19 5175
66 list-style file 2010.05.21 5366
65 php 에서 파일 권한 설정 2010.05.21 4843
64 putty file 2010.05.21 13643
63 리눅스 자동 시작 file 2010.05.21 16090
62 포커스 요소의 테두리와 웹 접근성 file 2010.05.23 4341