Using Redis with PHP

Source: Internet
Author: User
Tags install php

using Redis with PHP installation Please install the php-devel before installation
    1. $ yum Install Php-devel $ wget https://github.com/phpredis/phpredis/archive/2.2.4.tar.gz $ tar zxf 2.2.4.tar.gz $ cd ph predis-2.2.4 $/usr/bin/phpize

If There is a problem with/usr/local/bin/phpize execution, you can use whereis phpize to find phpize Where are the directories listed as

    1. Whereis phpize
$./configure--with-php-config=/usr/bin/php-config

If there is a problem with the./configure--with-php-config=/usr/bin/php-config execution, you can use Whereis php-config to find the Php-config column as

Whereis Php-config
    1. At last

    2. Make && make install

finally let PHP load Redis extensions first open php.ini if you don't know, use Whereis php.ini to find Vi/etc/php.ini Add the following on any line of php.ini extension=redis.so add complete save and restart Apache server Systemctl restart httpd in Apach E in the domain name of the new PHP file in the input phpinfo () view
<?php $redis = new Redis ();  $redis->connect (' 192.168.1.211 ', 6379);  $redis->set (' key ', ' Val ');  echo $redis->get (' key '); ?>



This article is from the "only" blog, please make sure to keep this source http://dadoubi.blog.51cto.com/12054595/1852445

Using Redis with PHP

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.