Introduction
cPanel provides the dependency manager composer, there are a few steps required for users so they can easily use it through the command line.
Procedure
By default the path the cPanel's provided composer is not present in the PATH environment variable, the path variable is what controls where the shell looks for a program.
To easily add the path you can add the following line to the accounts /home/$USER/.bash_profile file:
source /etc/profile.d/cpanel-php-composer.sh
This appends the path variable to include the path to composer:
# cat /etc/profile.d/cpanel-php-composer.sh
# This script amends the PATH variable for interactive shells so
# that the composer command can be run.
#################################################################
## NOTE: If you want to disable this file, comment out or ##
## delete the 'export' line below. If you simply delete the ##
## file itself, then it will come back the next time that you ##
## update cPanel & WHM. ##
#################################################################
export PATH="$PATH:/opt/cpanel/composer/bin"
The next time your user logs in through SSH they will be able to use composer:
Comments
0 comments
Article is closed for comments.