How to Use Composer on Kualo Servers
Knowledgebase Article
}
Knowledgebase Article
Composer is a popular dependency manager for PHP that allows you to manage your project's libraries and dependencies, and also facilitates autoloading of your project classes. At Kualo, we offer both major versions of Composer pre-installed to cater to your specific needs:
composer for Composer version 1.xcomposer2 for Composer version 2.xTyping one of the above commands when logged into SSH will allow you to use either version.
This article will guide you through the process of setting up Composer and configuring it according to your project's requirements.
Before you proceed, it's important to know which version of Composer your project requires. Some older projects may still rely on Composer 1.x, while most new projects would benefit from the improved performance and features of Composer 2.x.
If your PHP software or scripts are hardcoded to use composer but require version 2.x, you can set up a Bash alias to point composer to composer2.
Steps:
.bashrc file: Use a text editor like nano or vim to open the .bashrc file. If the file doesn't exist, you can create it.
nano ~/.bashrc
.bashrc file and add the following line:
alias composer='/usr/local/bin/composer2'
source ~/.bashrc
If your application allows you to specify the location of the Composer binary, you can set it to /usr/local/bin/composer2. This will direct the application to use Composer 2.x without needing to set up a Bash alias.
Powered by WHMCompleteSolution