How to compile and install extended redis and swoole in php

不言
Release: 2023-04-02 16:52:01
Original
1614 people have browsed it

This article mainly introduces the method of compiling and installing extensions redis and swoole in PHP. It has certain reference value. Now I share it with you. Friends in need can refer to it

1. Install redis extension

Download the redis expansion package and unzip it

wget https://github.com/edtechd/phpredis/archive/php7.zip
unzip php7.zip
Copy after login

Enter the decompressed directory, compile and install

cd data/pkg/phpredis-php7
/usr/local/php/bin/phpize
Copy after login

There is a problem

Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.
#安装autoconf
yum install autoconf
Copy after login

Start compiling pants Han

/usr/local/php/bin/phpize
Copy after login

Find php-config

find / -name php-config
Copy after login

Configuration environment

./configure --with-php-config=/usr/local/php/bin/php-config
Copy after login

Compile and install

make & make install
Copy after login

Configure php.ini, add redis.so extension

vim /usr/local/php/etc/php.ini
extension=redis.so
Copy after login

Restart php -fpm

killall php-fpm
/usr/local/sbin/php-fpm
Copy after login
Copy after login

2. Install swoole extension

Clone swoole

git clone https://gitee.com/swoole/swoole.git
Copy after login

Install swoole and compile

cd swoole
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install
Copy after login

Configure php.ini and add swoole.so Extension

vim /usr/local/php/etc/php.ini
extension=swoole.so
Copy after login

Restart php-fpm

killall php-fpm
/usr/local/sbin/php-fpm
Copy after login
Copy after login

The above is the entire content of this article. I hope it will be helpful to everyone's study. For more related content, please pay attention to the PHP Chinese website!

Related recommendations:

Analysis of service container and dependency injection in PHP

Analysis of PHP container Pimple running process

Instructions for php multi-process execution tasks

The above is the detailed content of How to compile and install extended redis and swoole in php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!