两个问题:
- Windows上如果用cygwin运行,会提示路径找不到(有workaround)
Could not open input file: /cygdrive/f/PhpstormProjects/fecshop/vendor/fancyecommerce/fecshop/shell/search/../../../../../yii
There are Could not open input file: /cygdrive/f/PhpstormProjects/fecshop/vendor/fancyecommerce/fecshop/shell/search/../../../../../yii products to process
There are Could not open input file: /cygdrive/f/PhpstormProjects/fecshop/vendor/fancyecommerce/fecshop/shell/search/../../../../../yii pages to process
2.如果直接一行一行拷贝出来运行,会有下面这个错误(mac上也有这个错误),terminal已经用了服务器里的php,也就是安装了php-mongodb.dll的php
Exception 'Error' with message 'Class 'MongoDB\Driver\Manager' not found'
in F:\PhpstormProjects\fecshop\vendor\yiisoft\yii2-mongodb\src\Connection.php:356
Stack trace:
#0 F:\PhpstormProjects\fecshop\vendor\yiisoft\yii2-mongodb\src\Command.php(184): yii\mongodb\Connection->open()
#1 F:\PhpstormProjects\fecshop\vendor\yiisoft\yii2-mongodb\src\Command.php(357): yii\mongodb\Command->execute()
#2 F:\PhpstormProjects\fecshop\vendor\yiisoft\yii2-mongodb\src\Collection.php(153): yii\mongodb\Command->createIndexes('full_search_pro...', Array)
#3 F:\PhpstormProjects\fecshop\vendor\fancyecommerce\fecshop\services\search\MongoSearch.php(87): yii\mongodb\Collection->createIndex(Array, Array)
#4 [internal function]: fecshop\services\search\MongoSearch->actionInitFullSearchIndex()
#5 F:\PhpstormProjects\fecshop\vendor\fancyecommerce\fecshop\services\Service.php(54): call_user_func_array(Array, Array)
#6 F:\PhpstormProjects\fecshop\common\services\Search.php(48): fecshop\services\Service->__call('initFullSearchI...', Array)
#7 [internal function]: common\services\Search->actionInitFullSearchIndex()