How to fix Composer should be invoked via the CLI version of PHP, not the cgi-fcgi SAPI error in SSH?

Put this in your bash profile and run source ~/.bashrc alias composer="/opt/cpanel/ea-php71/root/usr/bin/php /opt/cpanel/composer/bin/composer" As Composer is now available via WHM you can use this to find it: which composer This returned path “/opt/cpanel/composer/bin/composer” for me. If this returns nothing then disregard the rest of this answer, as Composer is not available to you at system level. You can now use php-cli to call this with Composer’s absolute path: php-cli /opt/cpanel/composer/bin/composer install php-cli /opt/cpanel/composer/bin/composer update php-cli /opt/cpanel/composer/bin/composer require whatever/example You may however need to alias php-cli if your system claims this isn’t found. It very much depends how PHP has been deployed on the WHM server. Learn how to fix PHP CLI error. You can do this by adding a user alias to the end of your “.bashrc” or “.bash_profile” file as follows: ...

February 12, 2019 · 1 min · Harshvardhan Malpani

How to edit default python version for a linux user?

Edit the bash profile and add an alias using the following code $ nano ~/.bashrc Put the following line of code in .bashrc file and alter the python3.6 path as per your new installation alias python='/usr/local/bin/python3.6' Use CTRL x to exit and save After that you need to reload the source, so use the following command and you are good to go. $ source ~/.bashrc

December 31, 2018 · 1 min · Harshvardhan Malpani

How to connect cpanel through SSH

Following are the steps to connect to cpanel through SSH:- Go to your cpanel and create a public private key-pair, under SSH access->manage keys. Under manage keys section, go on create a new key. Create a key and give key name, key password, key type and key size. 4. Click on generate keys and it will look something like this. Go back and under public key section , select your public key->manage->authorize key. ...

July 27, 2018 · 1 min · Harshvardhan Malpani

Linux commands for SSH

tar– to create archive files(.zip, .tar) Syntax: tar [options] [archive-file] [file or directory to be archived] Options: -c : Creates Archive -x : Extract the archive -f : creates archive with given filename -t : displays or lists files in archived file -u : archives and adds to an existing archive file -v : Displays Verbose Information -A : Concatenates the archive files -z : zip, tells tar command that create tar file using gzip -j : filter archive tar file using tbzip -W : Verify a archive file -r : update or add file or directory in already existed .tar file ...

July 27, 2018 · 4 min · Harshvardhan Malpani

How to update Magento community edition using CLI

composer require magento/product-community-edition 2.2.6 --no-update composer update rm -rf var/di var/generation var/cache var/view_preprocessed generated/* php bin/magento cache:clean php bin/magento cache:flush php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento indexer:reindex php bin/magento deploy:mode:set production if you receive any errors post installation, try this hard fix rm -rf app/code/Magento/ var/* vendor/* chmod 777 -R * composer update && composer install php -f bin/magento setup:static-content:deploy find . -type d -exec chmod 775 {} find . -type f -exec chmod 660 {} chmod u+x bin/magento bin/magento maintenance:disable bin/magento cache:clean

February 1, 2018 · 1 min · Harshvardhan Malpani

How to Update Magento 2.1x to latest version via SSH

composer require magento/product-community-edition 2.1.9 --no-update composer update rm -rf var/di/* var/generation/* var/cache/* var/log/* var/page_cache/* php bin/magento cache:clean php bin/magento cache:flush php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento setup:static-content:deploy php bin/magento indexer:reindex

September 26, 2017 · 1 min · Harshvardhan Malpani