블로그 이미지
BJcomm
bjcomm

공지사항

최근에 받은 트랙백

글 보관함

calendar

  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
08-14 15:33

redis 설치 및 php연동 운영

2015. 12. 17. 11:53 | Posted by bjcomm

redis-3.0.5.tar.gz

 

tar xvzf redis-3.0.5.tar.gz
cd redis-3.0.5
make

 

cd ..
mv redis-3.0.5 /usr/local/redis

 

cd /usr/local/redis

 

vi redis.conf

 

vi /etc/sysctl.conf
vm.overcommit_memory=1


sysctl vm.overcommit_memory=1
sysctl -w fs.file-max=100000

 

vi /root/.bash_profile
alias psredis='ps -u $USER -o pid,command | grep redis'
alias startredis='/usr/local/redis/src/redis-server /usr/local/redis/redis.conf'
alias stopredis='cat /var/run/redis.pid | xargs kill'

 

startredis
psredis
stopredis

 

pecl install igbinary
cp /usr/local/lib/php/extensions/no-debug-non-zts-20090626/igbinary.so /usr/local/lib/php/

 

pecl install redis
cp /usr/local/lib/php/extensions/no-debug-non-zts-20090626/redis.so /usr/local/lib/php/


vi php.ini
extension=/usr/local/lib/php/igbinary.so
extension=/usr/local/lib/php/redis.so

 

test


<?
$redis = new Redis();
$redis->connect('127.0.0.1',6379);
$redis->set('key','val');
echo $redis->get('key');
?>

Comment