How to install composer on cPanel server- Locally - inside the user's directory?

Composer is as tool which is used to manage the dependencies between the PHP softwares and required libraries for PHP. It will allow you to declare the standard libraries in PHP.

Though it's not package manager like 'Yum' but it deals with packages or libraries.

System Requirements -

1. PHP 5.3.2+
2. To install packages from sources instead of simple zip archives, you will need git, svn, fossil or hg depending on how the package is version-controlled.
3. Windows, Linux or OSX server.


Installation on Linux server (Locally - inside the user's home folder or where ever they specify)

1. Download the Composer executable for you using the command -
   wget https://getcomposer.org/download/1.2.1/composer.phar
2. Run the following command inside the user's home folder or where ever they specify via SSH -
    
curl -sS https://getcomposer.org/installer | php
3. Make sure the file is set to be owned by that user, by running this command-
   c
hown username:username composer.phar; chown username:username error_log
4. Composer is a PHP binary, so it needs to be like - php composer.phar OR ./composer.phar

Guidelines -

You can install composer to a specific directory by using the --install-dir option and providing a target directory. Options must be appended to -- so that PHP ignores them, like -- --install-dir=bin.
Example : php composer-setup.php --install-dir=bin

You can specify the filename (default: composer.phar) using the --filename option.
Example : php composer-setup.php --filename=composer--version

You can install composer to a specific release by using the --version option and providing a target release.
Example : php composer-setup.php --version=1.0.0-alpha8

Let me know if you've any questions.

Was this answer helpful?

 Print this Article

Also Read

FATAL: Failed to download updatenow.static from server: The system cannot update the /var/cpanel/sysinfo.config file. at /usr/local/cpanel/Cpanel/GenSysInfo.pm line 115 : upcp failed

You may come across the message "***** FATAL: Failed to download updatenow.static from server:...

Is it possible to add multiple backup destinations on the cPanel server?

Is it possible to add multiple backup destinations on the cPanel server?Solution :- Yes, its...

JFolder::create: Could not create directory - Warning! Failed to move file. Unable to find install package - Joomla Issue

While installing Extension in Joomla I was getting below error message - JFolder::create: Could...

Error:The system experienced the following error when it attempted to install the “OWASP ModSecurity Core Rule Set V3.0”

Issue while installing Comodo's WAF rules in cPanel - Error:The system experienced the following...

Your website needs to be publicly accessible to use Jetpack: site_inaccessible Error Details: The Jetpack server was unable to communicate with your site [HTTP 403].

I was getting the following error when connecting to the Wordpress native plugin Jetpack to...

Powered by WHMCompleteSolution