Phpredisadmin, predis, php-redis configuration Manual

Source: Internet
Author: User
Tags autoload redis server

 

The previous article has introduced the redis graphical interface management tool: phpredisadmin, URL: http://blog.csdn.net/wy3552128/article/details/8145319

Next let's talk about its installation. To put it bluntly, the phpredisadmin tool is a website under the web root directory of Apache or nginx.

Platform: Virtual centos4.7 on VMware

HOST: windows

Already installed: mysql, Apache, PHP, redis

Preparations before installing phpredisadmin:

1. You must install the Apache and PHP environments. redis can be deployed on other LAN servers. phpredisadmin specifies the IP address and port of the redis server in the configuration file.

2. Download phpredisadmin: https://github.com/ErikDubbelboer/phpRedisAdmin/downloads

3. Download predis (redis client: Predis, phpredis, Rediska, Redisent, iRedis, here I use predis, as long as it is placed under phpredisadmin): https://github.com/nrk/predis/downloads


Installation:

1. Decompress phpredisadmin and put it under the Apache website and Directory:/usr/local/apache2/htdocs/, name it phpredisadmin, and access http: // 192.168.0.118/phpredisadmin/. The system prompts that "predis/autoload" cannot be found. php ", we also need to put the predis under the phpredisadmin root directory

2、decompress predis(predis-0.8.tar.gz). The process is as follows:

 

[Root @ localhost ~] # Tar-zxf predis-0.8.tar.gz [root @ localhost ~] # Cd predis-0.8 [root @ localhost predis-0.8] # ll total usage 100-rw-rw-r -- 1 root 319 November 3 23:02 autoload. phpdrwxrwxr-x 2 root 4096 November 3 23:02 bin-rw-r -- 1 root 22338 November 3 23:02 CHANGELOG. md-rw-r -- 1 root 3264 November 3 23:02 CHANGELOG. NAMING. md-rw-r -- 1 root 737 November 3 23:02 composer. json-rw-r -- 1 root 2326 November 3 23:02 CONTRIBUTING. mddrwxrwxr-x 2 root 4096 August 2 23:02 examples-rw-r -- 1 root 8467 November 3 FAQ. mddrwxrwxr-x 3 root 4096 November 3 23:02 lib-rw-r -- 1 root 1067 November 3 23:02 LICENSE-rw-r -- 1 root 881 November 3 23:02 package. ini-rw-r -- 1 root 1183 November 3 23:02 phpunit. xml. dist-rw-r -- 1 root 1272 November 3 23:02 phpunit. xml. travisci-rw-r -- 1 root 10554 November 3 23:02 README. mddrwxrwxr-x 4 root 4096 November 2, November 3 23:02 tests-rw-r -- 1 root 10 November 3 VERSION [root @ localhost predis-0.8] # cd .. [root @ localhost ~] # Mv predis-0.8/*/usr/local/apache2/htdocs/phpredisadmin/predis/[root @ localhost ~] # [Root @ localhost ~] # Cd/usr/local/apache2/htdocs/phpredisadmin/predis [root @ localhost predis] # ll total usage 100-rw-rw-r -- 1 root 319 November 3 23:02 autoload. phpdrwxrwxr-x 2 root 4096 November 3 23:02 bin-rw-r -- 1 root 22338 November 3 23:02 CHANGELOG. md-rw-r -- 1 root 3264 November 3 23:02 CHANGELOG. NAMING. md-rw-r -- 1 root 737 November 3 23:02 composer. json-rw-r -- 1 root 2326 November 3 23:02 CONTRIBUTING. mddrwxrwxr-x 2 root 4096 November 3 23:02 examples-rw-r -- 1 root 8467 November 3 23:02 FAQ. mddrwxrwxr-x 3 root 4096 November 3 23:02 lib-rw-r -- 1 root 1067 November 3 23:02 LICENSE-rw-r -- 1 root 881 November 3 23:02 package. ini-rw-r -- 1 root 1183 November 3 23:02 phpunit. xml. dist-rw-r -- 1 root 1272 November 3 23:02 phpunit. xml. travisci-rw-r -- 1 root 10554 November 3 23:02 README. mddrwxrwxr-x 4 root 4096 November 3 23:02 tests-rw-r -- 1 root 10 November 3 23:02 VERSION [root @ localhost predis] #

Visit http: // 192.168.0.118/phpredisadmin/again to view the redis management interface.


---------------------------------------------- A satisfactory splitting line ---------------------------------------------------------------------

Install php-redis:

 

Download:Https://github.com/nicolasff/phpredis/tree/2.1.3

 

[root@localhost ~]# tar -zxf owlient-phpredis-2.1.1-1-g90ecd17.tar.gz[root@localhost ~]# cd owlient-phpredis-90ecd17[root@localhost owlient-phpredis-90ecd17]# /usr/local/php/bin/phpizeConfiguring for:PHP Api Version: 20090626Zend Module Api No: 20090626Zend Extension Api No: 220090626[root@localhost owlient-phpredis-90ecd17]# ./configure --with-php-config=/usr/local/php/bin/php-config[root@localhost owlient-phpredis-90ecd17]# make && make install

Next, edit php. ini under/usr/local/php/lib and add:

Extension_dir = "/usr/local/php/lib/php/extensions/no-debug-zts-20090626/" // check whether redis. soextension = redis. so exists in this path

Restart Apache

[Root @ localhost bin] #./apachectl restart

Test page:

[root@localhost htdocs]# vi redis.php<?php$redis = new Redis();$redis->connect('127.0.0.1',6379);$redis->set('test','hello world! hao a you');echo $redis->get('test');?>

Access the test page: http: // 192.168.200.102/redis. php

 

On the phpinfo () test page, check whether the php-redis extension is loaded:

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.