A PHP package and dependency manager, Composer can help you with manage and configure your cPanel account even better. For instance, with this manager, you can easily look for downloadable packages found at the website packagist.org.
In order to set up a composer on your cPanel account though, you should first have server SSH access. In addition you should have the version 58 of the cPanel & WHM.
Setting Up a Composer
For you to use this program, there are several things you need to do first. One of these is the installation of a number of PHP modules. You should also make sure that you have correctly configured the php.ini file of your server so that you will not have problems running Composer.
PHP Modules Required to Use Composer
In order to install the required PHP modules, you should log in as a root user. From there, you would have to enable the correct EasyApache PHP modules.
Here are the PHP modules you need to have the ability to use Composer.
PHP Directives Needed for Using Composer
There are also several PHP directives you have to update found in your account’s php.ini file. These include the following:
For Suhosin-Using Servers
For those who use servers with Suhosin, they have to add another module to their whitelist found in the php.ini.file of their server. This is the Phar PHP module.
Add the line “suhosin.executor.include.whitelist=phar” (without the quotation marks) to the php.ini file of your server.
Troubleshooting for Problems with Editing the php.ini File
Just in case you have trouble making changes to your server’s php.ini file, your last resort is to manually execute these commands when you need to use Composer.
When you always run Composer, you may want to create a Bash alias. Doing so will allow you execute the composer command without having to add any options or flags.
Adding any of the appropriate lines to the .bashrc file will allow you to generate the alias every time you log in to your server:
There are many other things you should know about Composer, but make sure you master the ones discussed above first.