swoole1.8.0+ version Asynchronous Redis installation (This example is swoole1.8.10 version) detailed

Source: Internet
Author: User
Tags redis
The swoole-1.8.0+ version adds support for asynchronous Redis clients based on Redis's official Hiredis library implementations. Swoole provides a __call magic method to map most Redis instructions (this installation instance is swoole1.8.10 version)

Compile installation Hiredis (swoole1.8.10 version asynchronous Redis support must be environmental conditions)
Using the Redis client, you need to install the Hiredis library. After downloading the Hiredis source code, executes

Make-j
sudo make install
sudo ldconfig (remember to execute the command when compiling the installation, or PHP will have a red font part error when introducing the Swoole extension)
PHP message:php warning:php startup:unable to load dynamic library '/usr/local/php/lib/php/extensions/no-debug-non-zts -20121212/swoole.so '-Libhiredis.so.0.13:cannot open Shared object file:no such file or directory in Unknown on line 0
HiredisDownload Address: Https://github.com/redis/hiredis(https://github.com/redis/hiredis/releases)
Enable Asynchronous Redis Client

Compile Swoole Yes, add in configure instructions --enable-async-redis

./configure--enable-async-redis
Make clean
Make-j
sudo make install

Because there are more extensions for Swoole (SSL, Debug, and so on), the actual compilation commands for picking up heavenly stars are as follows:

./configure--enable-async-redis--with-php-config=/usr/local/php/bin/php-config--enable-openssl-- Enable-swoole-debug--enable-sockets--enable-ringbuffer--enable-swoole


Swoole./configure has a number of additional parameters that can be viewed through the./configure--help command, where the default items are selected)
When the installation is complete, enter the/USR/LOCAL/PHP/ETC directory and open the php.ini file, adding the following sentence:
Extension=swoole.so
Then enter the command php-m in the terminal to view the extended installation (or view it through the phpinfo () function). If you see Swoole in the listed extensions, the installation is successful.

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.