This article describes how to install and configure PHP composer, the dependency manager solution. Composer enables you to manage dependencies for each project independently, and is used by frameworks such as Laravel.
To install composer, follow these steps:
echo 'alias composer="php -d allow_url_fopen=On ${HOME}/composer.phar"' >> ~/.bashrc source ~/.bashrc
You can use composer with alternate PHP versions as well:
echo 'alias php="/opt/php/php-5.5.0/bin/php"' >> ~/.bashrc echo 'alias composer="/opt/php/php-5.5.0/bin/php -d allow_url_fopen=On ${HOME}/composer.phar"' >> ~/.bashrc source ~/.bashrc
For more information about how to use alternate PHP versions on A2 Hosting servers that do not use CageFS, please see this article.
To download the composer installer, type the following commands:
cd ~ curl -k -O https://getcomposer.org/installer
To install composer, type the following command:
php -d allow_url_fopen=On installer
composer -V
Composer should display the version number. If it does not, repeat steps 2 to 4, paying close attention to the paths.
To update the composer installation to the newest version in the future, type the following command:
composer self-update
For more information about PHP Composer, please visit https://getcomposer.org.
Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.
We use cookies to personalize the website for you and to analyze the use of our website. You consent to this by clicking on "I consent" or by continuing your use of this website. Further information about cookies can be found in our Privacy Policy.