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

Magento 2.4.7 is here!
E-commerce
David Pratt

Magento 2.4.7 Has Arrived!

Magento 2.4.7 is set to land, with the latest release due to be launched on Tuesday the 9th of April 2024. The latest updates sees over 150 performance and security fixes as well as platform enhancements and upgrades.
Read More »
DTF Digital