🏆 India’s Tech, Global Scale: Unlimited Hosting for Your Limitless Growth.

How do I run Composer via SSH?

Last updated 1 week ago
38 Views
Using Specific PHP Versions with Composer on SSH Servers

At O2OHost, 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 O2OHost documentation or contact our support team.

Was this article helpful?

Let us know so we can improve our support.

Still need help?

Contact Support