laravel没有找到php库rdkafka

e4eetjau  于 2021-06-07  发布在  Kafka
关注(0)|答案(1)|浏览(614)

我要走了

Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR)
    Class 'RdKafka\Producer' not found

但是这个库是在php.ini中加载的,当我尝试使用php artisan tinker时,它可以工作,但在web应用程序中不工作

<?php

Route::get('/', function () {
    $topicConf = new RdKafka\TopicConf();
    $topicConf->set('auto.offset.reset', 'largest');

    $conf = new RdKafka\Conf();
    $conf->set('group.id', 'php-pubsub');
    $conf->set('metadata.broker.list', '127.0.0.1');
    $conf->set('enable.auto.commit', 'false');
    $conf->set('offset.store.method', 'broker');
    $conf->set('socket.blocking.max.ms', 50);
    $conf->setDefaultTopicConf($topicConf);
});
sqserrrh

sqserrrh1#

具有的用户
$conf=new\rdkafka\conf();

相关问题