2016-04-22 30 views
0

沒有選擇在magento Version2管理端重新索引。 試圖命令提示符reindex正在工作。但我的客戶不知道cmd提示符。還有其他選項可以重新索引數據。請幫幫我。Magento版本2 reindex選項不在管理端

+0

由於Stack Overflow是一個[編程相關](http://stackoverflow.com/help/on-topic)問答站點,因此我正在投票結束此問題。你的問題不是關於編程。也許你應該在http://magento.stackexchange.com上發佈它呢? – Enigmativity

回答

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重新索引。

+0

這不起作用。 reindex命令不正確。正確的語法是'php bin/magento indexer:reindex' –

+0

仍爲+1 –