Search code examples
macosindexingmampmcryptmagento2

Magento 2 reindex mcrypt blowfish error


I'm trying to reindex my Magento indexes through my terminal (I'm using osx & mamp) with this command:

php magento indexer:reindex

When I do this I receive the following error:

Could not open input file: magento

I Googled this error and it says that I'm supposed to use this command:

php bin/magento indexer:reindex

And that results into this error:

Use of undefined constant MCRYPT_BLOWFISH - assumed 'MCRYPT_BLOWFISH'

I looked it up and Google says that this is caused because I don't have mcrypt enabled in my php.ini, but I do have this enabled:

extension=mcrypt.so

How do I fix this?


Solution

  • Okay so apparently my terminal was pointing to the native PHP shipped with OSX.

    I had to go to my terminal, enter which php, which said /usr/bin/php, enter sudo nano ~/.bash_profile, paste export PATH=/Applications/MAMP/bin/php/php5.6.10/bin:$PATH, save and close the nano. Then I had to type . .bash_profile and restart the terminal. When I entered php bin/magento indexer:reindex after that it worked!