Quickbooks Desktop with Laravel "QuickBooks_Loader::load(): Failed opening required "



我正在尝试在我的Laravel 6项目中实现consolibyte/quickbooks-php。 如果我从控制器调用队列操作,它工作正常。但是现在我想与Laravel工作异步完成。这就是我收到错误的地方:

我收到此错误:

QuickBooks_Loader::load(): Failed opening required '/var/www/html/buyforme/b4m-aportal-v2/vendor/consolibyte/quickbooks/QuickBooks/Driver/.php' (include_path='.:/usr/share/php:/var/www/html/buyforme/b4m-aportal-v2/vendor/consolibyte/quickbooks')

它所指的这个特定行在 Loader 中.php:

if (QUICKBOOKS_LOADER_REQUIREONCE)
{
require_once QUICKBOOKS_BASEDIR . $file;
}

我记录了QUICKBOOKS_BASEDIR . $file,它所做的路径是正确的,文件就在那里。权限也是有效的。

Job:
class AddInventoryIntoQB 实现 ShouldQueue { 使用可调度、与队列交互、可排队、序列化模型;

/**
* Item object.
*/
protected $item;
/**
* @var LaravelQbd
*/
protected $QBD;

/**
* Create a new job instance.
*
* @param Item $item
*/
public function __construct(Item $item)
{
$this->QBD  = new LaravelQbd;
$this->item = $item;
}
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
$this->QBD->enqueue(QUICKBOOKS_ADD_INVENTORYITEM, $this->item);
}

LaravelQbd:

/**
* User Configuration File Array
*/
protected $dsn;
protected $config;
protected $map = [];
public function __construct()
{
$this->config = config('quickbooks');
$this->dsn    = $this->config['qb_dsn'];
}
public function enqueue($action, $object, $priority = 0, $extra = null, $user = null)
{
$Queue = new QuickBooks_WebConnector_Queue($this->dsn);
return $Queue->enqueue($action, $object, $priority, $extra, $user);
}

它只有在我不将其作为作业运行时才有效。我做错了什么?

此错误最可能的原因:

QuickBooks_Loader::load((: 需要打开失败 '/var/www/html/buyforme/b4m-aportal-v2/vendor/consolibyte/quickbooks/QuickBooks/Driver/.php'

格式不正确或为空的dsn连接字符串。也就是说,代码正在查找数据库驱动程序,而您指定要使用的数据库驱动程序不存在

在此代码中:

public function __construct()
{
$this->config = config('quickbooks');
$this->dsn    = $this->config['qb_dsn'];
}

你是:

  • 您是否 100% 确定qb_dsn甚至设置为一个值?
  • 是否 100% 确定它已设置为有效的 DSN 数据库连接字符串?
  • 字符串中是否有任何字符需要 URL 编码,实际上是 URL 编码正确?

您可以粘贴dsn字符串(屏蔽/删除密码(吗?

相关内容

最新更新