For all enquiries please call or email us. 01484 506220info@designthatfits.co.uk

Magento 2 SSH commands if using plesk

If you use plesk to run Magento 2 you might find difficulty when you come to run bin/magento commands
Jun 20, 2017
If you use plesk to run Magento 2 you might find difficulty when you come to run bin/magento commands

If you don't run php 7 by default in Plesk (which is often the case), you will struggle to use many of the SSH/command line commands.

Typically you'd navigate to your magento folder and run one of the following:

php bin/magento cache:flush
php bin/magento setup:static-content:deploy
php bin/magento indexer:reindex

Fortunately this is simple enough to resolve and just involves telling the php command which version of the PHP bin it should look at.

By adding: export PATH=/opt/plesk/php/7.0/bin:$path; prior to your command you can get PHP to use the correct version.

So, your new commands would be:

export PATH=/opt/plesk/php/7.0/bin:$path; php bin/magento cache:flush
export PATH=/opt/plesk/php/7.0/bin:$path; php bin/magento setup:static-content:deploy
export PATH=/opt/plesk/php/7.0/bin:$path; php bin/magento indexer:reindex

Return to articles
Fishpig's Wordpress extension was a key part of any magento 1.9.x project. This hasn't changed with Magento 2, but...
Marketing automation is a great asset for any business and once set up requires very little maintaining.
If you use plesk to run Magento 2 you might find difficulty when you come to run bin/magento commands
We'd suggest adding address lookup to the checkout.

Businesses can trust us to deliver effective online marketing solutions. Find out why.

Speak to an expert