我正在尝试使用终端artisan命令更新数据库中每个'供应商'的库存。
代码在浏览器中完美执行,但在终端中,我在第二次迭代中遇到“CLI已停止工作”错误:
$updateList = DB::table('inventory_variants')->where("vendor_id", "=", $v->id)->whereIn('id', $inventory["ids"])->get();
总代码:
foreach ($vendors as $v) {
$this->line($v->name.": Request Report");
$v->store = Vendor::newInstance($v->store_id, $v->api_secret_key);
$v->store->setInventory(); //Makes Curl Api call and sets inventory
}
foreach ($vendors as $v) {
if ($v->store->issetInventory()) {
$this->line($v->name.": Report Found, Starting Update");
$inventory = $v->store->getInventory();
$toUpdateItems = array('quantity' => array(), 'price' => array());
$updateList = DB::table('inventory_variants')->where("vendor_id", "=", $v->id)->whereIn('id', $inventory["id"])->get();
$this->updateInventory($toUpdateItems,$inventory); // Sets & Updates matching inventory
}
}
我在Windows 8上工作,使用wamp 2.5服务器,使用php 5.5.12和laravel框架。
我已阅读以前的帖子: PHP -> CLI has stopped working PHP inbuilt server gives "CLI has stopped working" wamp php CLI has stopped working
我尝试使用最新版本重新安装wamp。我已经尝试更新到最新的PHP,但无法弄清楚该怎么做。