Need to run 'composer update' on hostinger SSH, but php -v to low
You do need to download and install the composer locally. A step-by-step guide can be found here: Command-line installation.
$ php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
$ php -r "if (hash_file('sha384', 'composer-setup.php') === '55ce33d7678c5a611085589f1f3ddf8b3c52d662cd01d4ba75c0ee0459970c2200a51f492d557530c71c15d8dba01eae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
$ php composer-setup.php
$ php -r "unlink('composer-setup.php');"
This installer script will simply check some php.ini
settings, warn you if they are set incorrectly, and then download the latest composer.phar
in the current directory.
Once that’s done, a new file composer.phar will appear:
Composer (version 2.5.1) successfully installed to: /home/{your_directory}/composer.phar
Use it: php composer.phar
Now you will be able to run any command you’ve used before, as well as use commands like self-update
. Keep in mind that local composer commands should look like this: ./composer.phar
$ ./composer.phar self-update
Now you able to update you composer with below code:
$ /opt/alt/php81/usr/bin/php /home/{your_directory}/composer.phar update