How do I run Composer via SSH?

Hostkicker LLC

Last Update 9 maanden geleden

Using Specific PHP Versions with Composer on SSH Servers

At ServerByt, our SSH servers support multiple PHP versions. The default system-level PHP used for executing commands like Composer is a minimal version designed for internal tools and may not include all the modules available in your web-hosted PHP version. To run Composer or other PHP scripts with a specific PHP version, you need to explicitly specify the path to the desired PHP version.


Example: Using PHP 7.1 with Composer
  1. Identify Available PHP Versions:

    • Upon logging into your SSH session, check the Message of the Day (MOTD) for a list of available PHP versions.
  2. Execute Composer with a Specific PHP Version:

    • Use the full path to the PHP version you wish to utilize for running Composer. For example, to use PHP 7.1, you would execute the following command:

      /usr/bin/php71 -f /usr/bin/composer
    • To run Composer commands, such as installing dependencies, specify the full command:

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

By specifying the full path to the desired PHP version, you ensure that Composer and other PHP scripts run with the appropriate environment and modules required for your application.

For further assistance or additional information on available PHP versions, please consult the ServerByt documentation or contact our support team.

Was this article helpful?

0 out of 2 liked this article

Still need help? Message Us