Magento 2 setup:upgrade troubleshooting

If you’ve ever like me encounter this problem when executing magento setup:upgrade command. Try the following solution.

screen-shot-2016-12-06-at-1-06-59-pm

Get MySQL socket value

Login to your mysql from the terminal or pgadmin. Run the sql command to get socket value.

show variables like '%sock%';

 

screen-shot-2016-12-06-at-1-09-05-pm

Php.ini

In your php.ini make sure you have the correct value. For my case, “/Applications/mampstack-7.0.12-0/mysql/tmp/mysql.sock”

mysql.default_socket = "/Applications/mampstack-7.0.12-0/mysql/tmp/mysql.sock"
mysqli.default_socket = "/Applications/mampstack-7.0.12-0/mysql/tmp/mysql.sock"
pdo_mysql.default_socket = "/Applications/mampstack-7.0.12-0/mysql/tmp/mysql.sock"

 

Which PHP

Run command to identify which php you’re using.

which php
/usr/bin/php

 

mingchs-MacBook-Air:magento mingch$ php -i | grep 'php.ini'
Configuration File (php.ini) Path => /etc

In my case, although I’ve mamp install, but my php command still using default php from /usr/bin/php.

 

Swap php

Edit profile, and add export to the first line

vi ~/.bash_profile

export PATH=/Applications/mampstack-7.0.12-0/php/bin:$PATH

 

Double check

Open a new terminal, and run the command again to double check you’ve using the right php.

mingchs-MacBook-Air:magento mingch$ php -i | grep 'php.ini'
Configuration File (php.ini) Path => /bitnami/mampstackDev-osx-x64/output/php/lib
Loaded Configuration File => /Applications/mampstack-7.0.12-0/php/etc/php.ini

mingchs-MacBook-Air:magento mingch$ which php
/Applications/mampstack-7.0.12-0/php/bin/php

 

Setup:upgrade

Run setup:upgrade command again, it will clear the cache and update the modules successfully.

screen-shot-2016-12-06-at-1-40-21-pm

 

 

Magento 2 setup:upgrade troubleshooting

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.