Kselax.ru

Hacker Kselax – the best hacker in the world

Menu
  • Blog
  • Contacts
  • wp plugin generator
  • English
    • Русский
Menu
install redis with php

How to install PHP Redis client

Posted on 26 June, 201830 July, 2018 by admin

The PHP Redis client will be phpredis

At first, we have to be sure that php5.6-dev is installed.

1
sudo apt-get install php5.6-dev

Then install package

1
sudo pecl install redis

in type installation, you will be asked a few times and always answer no

and last you need to add to the php.ini file this line and restart apache2 server

1
extension=redis.so

Now we can test our Redis by executing this code

1
2
3
4
5
6
<?php
$redis = new Redis();
$redis->connect('127.0.0.1', 6379);
echo $redis->set('hello', 'here we go', 60)."\n";
echo $redis->get('hello');
?>

Main Redis client on your ubuntu must have been installed, if still not, use this video instruction

 

If you don’t understand something, you can always ask me by commenting on this post

 

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • bash (1)
  • English (9)
  • JavaScript (4)
  • node.js (22)
  • photoshop (1)
  • php (3)
  • React (9)
  • sclerotic (6)
  • Ubuntu (10)
  • Uncategorized (15)
  • Wordpress (1)

Tags

Ajax apache2 automation bash chrome-extension command line editor ejs email English English-grammar framework functions git graphql handlebars hybrid app installation javascript js linux newbie node.js node.js javascript nodemailer npm objects Performance php phpmyadmin playonlinux promise rabbitmq React react-router redis reverse-proxy session shell socket.io sublime text 3 time zones ubuntu unity webpack

Recent Comments

  • damien on How to install npm and nodejs the latest versions on ubuntu
  • Cam on How to install npm and nodejs the latest versions on ubuntu
  • Pierre on socket.io with apache as a reverse proxy on the CentOS
  • admin on How to use react-router with a few languages
  • admin on How to install npm and nodejs the latest versions on ubuntu
©2021 Kselax.ru Theme by ThemeGiant