Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install redis extension for PHP under Linux

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the PHP under Linux how to install redis extension, the article is very detailed, has a certain reference value, interested friends must read it!

Description: operating system: CentOS

Php installation directory: / usr/local/php

Php.ini profile path: / usr/local/php/etc/php.ini

Nginx installation directory: / usr/local/nginx

Nginx website root: / usr/local/nginx/html

Linux php install the redis extension step 1, install the compiler tool yum install wget make gcc gcc-c++ zlib-devel openssl openssl-devel pcre-devel kernel keyutils patch perl

2. Install redis download: https://github.com/nicolasff/phpredis/archive/2.2.4.tar.gz

Upload phpredis-2.2.4.tar.gz to / usr/local/src directory

Cd / usr/local/src # enters the package storage directory

Tar zxvf phpredis-2.2.4.tar.gz # decompression

Cd phpredis-2.2.4 # enter the installation directory

/ usr/local/php/bin/phpize # generate configure configuration file with phpize

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

Make # compilation

Make install # installation

After the installation is complete, the following installation path appears

/ usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/

3. Configure php to support vi / usr/local/php/etc/php.ini # editing the configuration file, and add the following on the last line

Add

Extension= "redis.so"

: wq! # Save exit

4. Test vi / usr/local/nginx/html/index.php # edits

: wq! # Save exit

When the browser opens index.php, as shown in the following figure, you can see the information about redis.

The above is all the contents of the article "how to install redis extensions for PHP under Linux". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report