user3478148
user3478148

Reputation: 443

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?

Upvotes: 0

Views: 3541

Answers (2)

Shahzaib Hayat Khan
Shahzaib Hayat Khan

Reputation: 1001

FOR UBUNTU USERS

This is because your terminal PHP is not pointing to the one with the configuration. Try this command ( update command with whatever the php version inside lampp/bin/? )

sudo /opt/lampp/bin/php magento indexer:reindex

If it worked this way then follow this below mentiond link to make this php default for your settings.

https://askubuntu.com/questions/146903/make-php-recognized-as-a-command-in-terminal

This worked for me.Thanks @user3478148. I wish i could have upvote your comment but don't have that much reputations now.

Upvotes: 1

user3478148
user3478148

Reputation: 443

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!

Upvotes: 2

Related Questions