1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Installing Composer on a Web hosting or a Cloud Server
Composer is an open source dependencies manager written in PHP. It enables its users to register and install the libraries required by the main project.
- log in to your host via SSH (find out more)
- in the terminal, enter the following command: cd ~
- enter: mkdir .composer
- enter: export COMPOSER_HOME="~/.composer"
- enter: curl -sS https://getcomposer.org/installer | php -d allow_url_fopen=On
- Composer is now available on your hosting
Launch Composer anywhere
It is not possible to install Composer globally on the server (shared / Cloud). Nevertheless, once the above instructions have been followed, execute the following command in SSH to launch Composer anywhere:
"folderComposer" is to be changed for the absolute path of Composer (given during its installation).
If you wish to type "composer" instead of "composer.phar", you can rename the Composer file as follows, by placing yourself in SSH in the Composer folder:
For the change to remain after reconnecting in SSH, you must add it in SSH in your profile:
- create a .profile file if none exists: touch ~/.profile
- edit the .profile file:nano ~/.profile
- add the code to the interior of the file: export PATH=$PATH:/folderComposer
- load the .profile file: source ~/.profile
Change the version of PHP used in SSH: https://www.infomaniak.com/en/support/faq/2108/configuringchanging-the-php-version-used-in-ssh