Skip to content

Instantly share code, notes, and snippets.

@medigeek
Created July 9, 2021 15:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save medigeek/9f9f1aacb2e4ea7822527002cfbedf43 to your computer and use it in GitHub Desktop.
Save medigeek/9f9f1aacb2e4ea7822527002cfbedf43 to your computer and use it in GitHub Desktop.
Invalidate magento 2 reindex
<?php
//set your indexer to update on schedule
//and make sure your cronjob for magento is running
header("Content-type: text/plain");
//Assuming the php script is in pub/ subfolder. You can put it wherever.
chdir(__DIR__.'/../');
$out = shell_exec('php bin/magento indexer:reset');
echo("\n".$out."\n");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment