Composer is a device for dependency management in PHP. It allows you to declare the libraries your project depends on, and it will deal with (set up/update) them for you. Composer is not a package deal manager in the similar sense as Yum or Apt are. Yes, it specials with ‘packages’ or libraries, but it manages them on a for every-undertaking basis, installing them in a listing (e.g., vendor) within your challenge. By default, it will never set up nearly anything globally. As a result, it is a dependency manager.
To set up Composer:
1. SSH obtain really should be enabled for your web hosting account with us. Follow the techniques delivered in this post to switch SSH accessibility on.
2. To accessibility your account by way of SSH, download and set up a person of the accessible SSH clientele. You can uncover the listing of totally free SSH purchasers here. In scenario you are employing a Unix-dependent OS (Linux or OSX), you can conveniently run the Terminal software and link to the server working with the command:
ssh username@servername -pPORT
ssh – command for logging into the remote server
username – your cPanel username
servername– title of the server the place your web hosting account is located (you can find it utilizing this tutorial)
PORT – relationship port – 21098 for a Shared Hosting servers, 22 – for a VPS/Dedicated server
3. Open up your SSH consumer, put your area title or the IP address of the server into the Host Name field, enter 21098 or 22 into the Port industry, select SSH as your relationship kind and push the Open button:
4. If you get PuTTY Security Warn, press Sure: 

When prompted, enter your cPanel username and password (when you enter the password, it is routinely hidden for safety purposes):
5. Composer necessitates PHP 5.5+ model, so we will need to examine whether the wanted version is set up. Kind the php -v command in PuTTY (or in Terminal) and you will get the following output:

6. If you need to have to change PHP edition, log in to your cPanel, navigate to Program and Expert services part >> Find PHP Edition menu:
7. Select 5.5-7.3 model from the fall-down menu and then click on the Established as latest button:

You should Take note: Composer necessitates permit_url_fopen. It is enabled by default for all php versions on our Shared servers. Even now, you might test if it is On by going to Change to PHP Settings in Pick PHP variation menu:
You can also discover added data about PHP selector in this article.



8. Future, navigate to the folder you want to set up Composer in. In our illustration, we will install Composer in community_html:
cd community_html
9. Now, you will have to have to locate or generate the php.ini file and some values to it. Log in to cPanel and navigate File Supervisor menu:

10. Go to the folder your Composer will be installed in and develop a new file named php.ini working with the +File button:
11. Open up it by suitable-clicking the made php.ini file >> Edit:
12. Then incorporate the next values to the file and hit the Help save Alterations button:

max_execution_time = 300
max_input_time = 300
memory_limit = 512M
suhosin.executor.include.whitelist = phar
detect_unicode = Off
13. When all the preparations are done, you are prepared to put in Composer. Open up PuTTY window in which you have logged into your cPanel account and fill in the next command:
php -r "readfile('https://getcomposer.org/installer')" | php -c php.ini

This will execute the Composer set up:

To run composer commands use:
or
php -c php.ini composer.phar
In case you get a notification Some settings on your equipment make Composer unable to operate appropriately, make certain that the PHP model is 5.5 or higher and all the modifications in the php.ini file are saved. 


Which is it!
Recent Comments