Magento version2 reindex选项不在管理员端

时间:2016-04-22 06:21:58

标签: magento

没有选项可以在magento Version2管理端重新编制索引。 试图命令提示reindex工作正常。但我的客户不知道cmd提示。还有其他选项可以重新索引数据。请帮帮我。

1 个答案:

答案 0 :(得分:1)

<?php 
ini_set('display_errors', 1);
try {
$indx = shell_exec(escapeshellcmd("php bin/magento indexer:reindex"));
echo '<pre>';
print_r($indx);
} catch(Exception $e)
{
    print_r($e);
}
?>

将此代码粘贴到magento2根目录中名为reindex.php的文件中。然后使用{magento-url}/reindex.php重新编制索引。