

Finally, test the Composer installation:.Once the installation process is complete, remove the installer:.You should get the following result: All settings correct for using ComposerĬomposer (version 2.4.2) successfully installed to: /usr/local/bin/composer Global Installation php composer-setup.php -install-dir=/usr/local/bin -filename=composer Local Installation php composer-setup.php However, the global installation method won’t work on shared and cloud hosting.

Meanwhile, the global installation allows you to run Composer from anywhere on your system by storing it in the /usr/local/bin directory. Local installation means the dependency manager will be stored in your current directory, and you must specify the path before executing corresponding commands.

Otherwise, open a terminal window on Linux or macOS. Note that this is only applicable for shared and cloud hosting only. Connect to your hosting account using an SSH connection.

Otherwise if you need a newer 2.0 version or you are using PHP 8.0+, use the composer2 command.įollow these steps to install Composer on your system: If you need Composer version 1.10, use the composer command. Hostinger provides its users with two Composer versions.
