sh fullSearchSync.sh 报错,打印出页数和产品数为空

安装报错 · kyohaha · 于 5年前 发布 · 2084 次阅读

使用docker安装的 运行sh fullSearchSync.sh 提示/usr/bin/env: php: No such file or directory 打印出页数和产品数都是空的 ,报错信息如下图: /usr/bin/env: php: No such file or directory There are products to process There are pages to process

ALL BEGINING

fullSearchSync.sh: line 17: ((: i<=: syntax error: operand expected (error token is "<=")

共收到 7 条回复
Fecmall#15年前 0 个赞

图呢?

Fecmall#25年前 0 个赞

这个脚本:https://github.com/fecshop/yii2_fecshop/blob/master/shell/search/fullSearchSync.sh#L17:17

你的fecshop根目录下面没有文件 yii ? 如果没有的话,说明你没有执行 ./init 命令,详细看文档:

Fecmall#35年前 0 个赞

好像,升级了阿里云的网络,导致不能传图了

kyohaha#45年前 0 个赞

google和火狐都上传图片失败。 有yii啊,执行了那个脚本,我的是cenos 7 看到有个帖子改成#!/bin/bash 也不行

Fecmall#55年前 0 个赞

你打开那个脚本文件,可以看到脚本详细

首先,你是否有产品?如果有,说明是功能的问题

你在根目录下执行 ./yii product/search/syncpagenum 看看, 这个脚本对应文件为: https://github.com/fecshop/yii2_fecshop/blob/master/app/console/modules/Product/controllers/SearchController.php 中的

public function actionSyncpagenum()
    {
        $filter['select'] = ['_id'];
        $filter['where'][] = ['is_in_stock' => 1];
        $filter['where'][] = ['status' => 1];
        $count = Yii::$service->product->collCount($filter);
        echo ceil($count / $this->_numPerPage);
    }

Yii::$service->product->collCount($filter); 就是:https://github.com/fecshop/yii2_fecshop/blob/master/services/product/ProductMongodb.php 中的方法

public function collCount($filter = '')
    {
        $query = $this->_productModel->find();
        $query = Yii::$service->helper->ar->getCollByFilter($query, $filter);
        return $query->count();
    }

你自己排查一下,是哪里导致的。

Fecmall#65年前 1 个赞

你是不是搞错地方了? 这个脚本需要进入到php的容器里面运行,你是不是在宿主主机运行的?

我猜测是这个原因导致的,

https://github.com/fecshop/yii2_fecshop_docker

9.2然后在根目录(docker-compose.yml文件所在目录)下执行,进入php的容器

7楼 已删除.
kyohaha#85年前 0 个赞

:tw-1f202::明白了。 docker-compose exec web php 然后 cd /www/web/fecshop/vendor/fancyecommerce/fecshop/shell/search sh fullSearchSync.sh

添加回复 (需要登录)
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册
Your Site Analytics