首页 文章

Magento 2.1.8重新索引错误

提问于
浏览
1

我是Magento的新手,我在重新索引方面遇到了麻烦 .

我已经通过重新索引问题检查了所有问题,但我的问题不同了 . 我的Cron作业显示以下错误:

Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors.

我已经删除了php.ini中的memory_limit,但它仍然是相同的 .

我的Cron工作:

***** php /home/username/public_html/update/cron.php >> /home/username/public_html/var/log/update.cron.log

有人可以帮忙吗?
enter image description here

以下命令: * * * * * <path_to_php> <magento2_dir>/update/cron.php >> <magento2_dir>/var/log/update.cron.log

给出了输出

X-Powered-By: PHP/5.6.31 
Content-type: text/html; charset=UTF-8

但 . 我的索引没有重新索引 . 我正在使用Cpanel .

2 回答

  • 0

    您需要为Magento2网上应用店设置正确的 CRON

    要设置 CRON ,您需要执行以下操作:

    通过SSH登录到您的服务器

    使用此命令编辑cronjobs

    crontab -e

    在此之后显示文本编辑器 . (您可能需要先选择文本编辑器 . )

    在这里你需要添加以下行(确保更改环境的路径)

    * * * * * <path_to_php> <magento2_dir>/bin/magento cron:run | grep -v "Ran jobs by schedule" >> <magento2_dir>/var/log/magento.cron.log
    * * * * * <path_to_php> <magento2_dir>/update/cron.php >> <magento2_dir>/var/log/update.cron.log
    * * * * * <path_to_php> <magento2_dir>/bin/magento setup:cron:run >> <magento2_dir>/var/log/setup.cron.log
    

    这里:

    <path_to_php> 通常 /usr/bin/php 你可以通过命令 which php 找到这个如果你已经安装了php-cli而不是你需要为php-cli分配路径

    <magento2_dir> 是Magento2安装的根目录 .

    以下是必须有MONnto2的CRON

    bin/magento cron:run
    

    例如:

    * * * * * /usr/bin/php /home/username/public_html/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /home/username/public_html/var/log/magento.cron.log
    * * * * * /usr/bin/php /home/username/public_html/update/cron.php >> /home/username/public_html/var/log/update.cron.log
    * * * * * /usr/bin/php /home/username/public_html/bin/magento setup:cron:run >> /home/username/public_html/var/log/setup.cron.log
    

    注意:如果您有 cPanel 或其他面板,您需要找到 cron / scheduler 并相应地设置相同的面板

  • 1

    你必须联系你的服务器人员 . 它们会增加服务器内存限制 . 或者你可以做的事情 . 首先使用SSH进行索引,然后尝试设置cron作业 . 我希望它会对你有所帮助 .

相关问题