duanpaotian2348 2016-09-22 08:08
浏览 124

php工匠队列:工作不使用mongodb和laravel 5.2

I have installed laravel 5.2.0 and https://github.com/jenssegers/laravel-mongodb , and want to send emails via queue. I've created jobs table successfully but when running php artisan queue:work command it is throwing following error -

PHP Fatal error: Call to a member function beginTransaction() on null in /var/www/html/admin/setupl/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 576

I've checked database connection , here is my complete logs in command line - enter image description here

I've spent many hours to resolve it but still not working.Any help would be really appreciated , thanks much.

Edit - As suggested "MongoDB do not have transactions, so when Laravel tries to begin one an exception is throwed" here https://github.com/jenssegers/laravel-mongodb/pull/871 , I have commented codes in beginTransaction and commit() and return null, now error has gone but still command not working.

public function commit()
{
    return null;
}

And

public function beginTransaction()
{
    return null;
}
  • 写回答

2条回答 默认 最新

  • dongtuliao6760 2016-09-28 10:08
    关注

    It's better if you just use Redis as cache for Laravel. It's much more appropriate for queues and has native support. I use Redis as worker queue and Mongo as db

    评论

报告相同问题?

悬赏问题

  • ¥30 vmware exsi重置后登不上
  • ¥15 易盾点选的cb参数怎么解啊
  • ¥15 MATLAB运行显示错误,如何解决?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
  • ¥20 yolov5自定义Prune报错,如何解决?
  • ¥15 电磁场的matlab仿真
  • ¥15 mars2d在vue3中的引入问题
  • ¥50 h5唤醒支付宝并跳转至向小荷包转账界面