我要走了
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);
});
1条答案
按热度按时间sqserrrh1#
具有的用户
$conf=new\rdkafka\conf();