Hi, we are on shared hosting using cpanel running magento 2.1 on php7. We are getting an error “One or more indexers are invalid. Make sure your Magento cron job is running.”. Can we run the same commands above from cpanel? Please help.
1: Go in cpanel and find the magento 2 directory path
2: Go to cronjobs.
3: Add the cron job
/usr/bin/php -q /pathto/public_html/Magento2/Crondirectory/sample-mail.php
You can test the cronjob by placing the mail code
$message = “”;
$from = "firstname.lastname@example.org";
$to = "email@example.com";
$subject = “PHP Mail Test script”;
$message.= “test email”;
$headers = “From:” . $from;
Also please restart the apache also if not getting any results.