Home > Backend Development > PHP7 > body text

How to install kafka extension in php7

醉折花枝作酒筹
Release: 2023-02-17 22:14:02
forward
1498 people have browsed it

This article will introduce to you how to install kafka extension in php7. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.

How to install kafka extension in php7

1. Install librdkafka

# cd /usr/local/src/
# git clone https://github.com/edenhill/librdkafka.git
 # cd librdkafka
 # ./configure
 # make
 # make install
 # ln -s /usr/local/lib/librdkafka.so.1 /usr/lib/
Copy after login

2. Install php-rdkafka

# cd /usr/local/src/
 # git clone https://github.com/arnaud-lb/php-rdkafka.git
 # cd php-rdkafka
 # /usr/local/php/bin/phpize
 # ./configure --with-php-config=/usr/local/php/bin/php-config
 # make all -j 5
 # make install
Copy after login

3. Modify php.ini

# vi /etc/php.ini
Copy after login

##Add the following code:

##
extension=rdkafka.so
Copy after login

## Check whether the installation is successful:

##
# /usr/local/php/bin/php  -m
Copy after login

4. Restart php-fpm

# service php-fpm restart
Copy after login

Recommended learning: php video tutorial

The above is the detailed content of How to install kafka extension in php7. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
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!