Question
What is the scl utility and how do I utilize it?
Answer
The scl utility allows you to run packaged software within the software collection environment. We utilize the software collections to allow the installation of multiple versions of PHP in EasyApache 4.
View software collections
You can view the software collections by typing the following:
scl -l
You should see similar output as this:
[cptech@server ~]# scl -l
ea-php54
ea-php55
ea-php56
ea-php70
[cptech@server ~]#
View which modules have been installed
You can see which modules have been installed for a particular software collection by typing the following:
scl enable X 'php -m'
Where “X” is the software collection. So if you wanted to search only within ea-php72 you could type the following:
scl enable ea-php72 'php -m'
Typing “scl enable ea-php72” ensures that you to execute your commands in the specified software collection’s environment (in this example, ea-php72).
Bash Shell
You can also run a bash shell within the software collection by typing the following:
scl enable ea-php72 /bin/bash
Once you do that you can then type the following to view the installed modules for ea-php56:
php -m
You could even install a module via pecl with the following:
pecl install mongodb
Once you want to leave the software collection’s environment type the following:
exit
If you are not in the software’s collection environment, you could also install the same module by typing the following:
/opt/cpanel/ea-php72/root/usr/bin/pecl install mongodb
This will specify the full path to the PHP 72 pecl binary to install the module.
Comments
0 comments
Article is closed for comments.