Composer is the standard dependency manager for PHP projects. You can run it over SSH on FimuroHost Cloud Hosting, but there is one important detail: you need to tell it which PHP version to use.
Why the extra step?
The platform offers several current PHP 8.x versions for your websites. The default PHP you get when you simply type php in SSH is a basic system version that is missing many of the modules your sites use. If Composer runs with it, installs can fail with missing-extension errors.
The fix is to call the PHP version you want by its full path and pass Composer to it.
How to run Composer
- Connect to your hosting over SSH.
- Look at the welcome message (the "message of the day") shown when you log in. It lists the PHP versions available and their paths.
- Change to your project folder, for example:
cd public_html - Run Composer using this pattern:
Replace/usr/bin/phpXX -f /usr/bin/composer installphpXXwith the version you want, using the exact name from the welcome message (for examplephp83).
Any Composer command works the same way; just change the last word:
/usr/bin/phpXX -f /usr/bin/composer update /usr/bin/phpXX -f /usr/bin/composer require vendor/package /usr/bin/phpXX -f /usr/bin/composer dump-autoload
Tips
- Match your website's PHP version. Use the same version your site runs in StackCP, so the packages Composer picks are compatible.
- Save typing during a session with an alias:
After that,alias composer='/usr/bin/phpXX -f /usr/bin/composer'composer installworks as normal until you log out. - Production installs: use
install --no-dev --optimize-autoloaderon a live site to skip development packages. - Long installs: SSH commands are not limited by the web request time limit, so large installs are fine here.
Need help?
Our support team is happy to take a look. Open a ticket at app.fimurohost.com/submitticket.php or message us on WhatsApp at 01818160926.
Categories
Written by
FimuroHost Team
Technical Writer