The PHP extension installation of Redis in Linux

Source: Internet
Author: User
Tags install redis

Extensions in PHP are usually installed in the installation environment. But some of the extensions that you want to add later are also possible. PHP supports post-installation extensions.

To install an extension, you need to download the extended source package needed to install the extension first. Autoconf.tar.gz and phpredis.tar.gz need to leave a mailbox or +q472368077

The file is uploaded to the/usr/local/redis directory via FTP for decompression.

Locate the PHP running directory/usr/local/php/bin/, locate the executable phpize find the path, and then go back to the Phpredis directory of the Unpacked folder.

Cd/usr/local/redis/phpredis

Executive Phpize

/usr/local/php/bin/phpize

Because the normal order of installation should be to install Redis and then install PHP, now we execute the order exactly the opposite. So executing the/usr/local/php/bin/phpize command can fix the problem of the installation sequence.

Role: You can reverse-install the Redis extension into PHP.

After executing the command, you will be told that you need autoconf software dependencies, and then install autoconf

Cd..

Tar zxvf autoconf.tar.gz

CD autoconf

./configure

Make && make install

Cd..

CD Phpredis

/usr/local/php/bin/phpize

New Executive Phpize

./configure--with-php-config=/usr/local/php/bin/php-config

Configure the PHP configuration path for Redis

Make && make install

ls/usr/local/php/lib/php/extensions/no-debug-***/See if there is a redis.so (* * * for the file name in your directory)

This is the extension file for the PHP extension, which needs to be referenced in the php.ini

Cd/usr/local/php/lib This directory has a php.ini

Vim php.ini

/extension find the location of the reference file.

Adding a line extension=redis.so introducing a redis extension

: Wq Save Exit

Restart Apache/usr/local/httpd/bin/apachectl restart

After restarting, go to a php file output phpinfo () to see if the extension is installed.

  

  

  

The PHP extension installation of Redis in Linux

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.