php环境下使用kafka
一、搭建好kafka环境
二、php使用kafka需要装扩展:
1、安装kafka的扩展之前,在安装php-rdkafka之前,需要先安装librdkafka
git clone https://github.com/edenhill/librdkafka.git
cd librdkafka
./configure
make && make install
2、安装rdkafka
git clone https://github.com/arnaud-lb/php-rdkafka.git
cd php-rdkafka
phpize
./configure --with-php-config=
/usr/local/php/bin/php-config ###你安装的php下的php-config路径
make && make install
3、在php.ini中添加行 ###在php下面的/etc/php.ini 编辑
extension=rdkafka.so


4、重启php后访问php测试页面验证:

相关推荐
-
PHP8种变量类型的详细讲解2025-02-22 00:32:24
-
php+apache 和 php+nginx的区别2025-02-22 00:21:27
-
PHP:与workerman结合实现定时任务2025-02-22 00:15:57
-
Nginx的Rewrite规则与实例2025-02-22 00:15:39
-
MySql中身份证字段的简单脱敏介绍2025-02-22 00:15:36