Home > Backend Development > PHP Tutorial > PHP compiles and installs extensions redis and swoole

PHP compiles and installs extensions redis and swoole

藏色散人
Release: 2023-04-07 10:38:01
forward
3202 people have browsed it

PHP compiles and installs extensions redis and swoole

1. Install the redis extension

Download the redis extension package and decompress it

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

Enter decompression Back directory, compile and install

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

Problems occur

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 compilation

/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, 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

Recommended tutorial: PHP video tutorial

The above is the detailed content of PHP compiles and installs extensions redis and swoole. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:segmentfault.com
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