How do I run Composer via SSH

How do I run Composer via SSH

At VISYOO we run multiple different versions of PHP.

On our SSH servers, the execution of commands like “composer” will run with our default, system-level PHP that is also used for internal tools at VISYOO. This is a thin version of PHP without all the modules you may be used-to on your website. To enable use of this command, you need to specify the full path to the version of PHP that you wish to run the script as. You can do this on the command line itself.

Here's an example of using PHP 7.1 to execute Composer:

/usr/bin/php71 -f /usr/bin/composer

So the complete command would become:

/usr/bin/php71 -f /usr/bin/composer install

A list of available PHP versions is presented to you in the message of the day (MOTD) once you login to SSH.

    • Related Articles

    • How do I connect via SSH?

      It's only recommended that you connect to your package via SSH if you're familiar with the command line interface.  Windows If you're using Windows, you'll need to download an SSH Client to access SSH. This guide uses PuTTY which is a free SSH client ...
    • How do I connect via SSH on an Apple Mac?

      To connect via SSH on a Mac you can follow the instructions below: Log in HERE. Head to Manage Hosting and select Manage on the hosting package you want to connect to. Select the SSH Access icon. You’ll now need to generate a public key, on a Mac ...
    • How do I connect via SSH using 2FA?

      It's only recommended that you connect to your package via SSH if you're familiar with the command-line interface. Here is how to connect using two-factor authentication (2FA). Windows If you're using Windows you will want to download an SSH client ...
    • How do I import a .sql file via the command-line?

      If you've set up SSH access for a package then you can run the following command-line instructions to import a MySQL database: mysql -h hostname -u username -p username < databasefile.sql The above command connects to your database with the -h ...
    • How do I upload a large file via FTP?

      The maximum FTP upload/download size is 5GB, above which you’ll need to use another method to transfer larger files sizes. One way we’d recommend is to enable SSH action and then use a client like WinSCP to upload over SSH. There are no limits in ...