Installing Composer in VMBitrix
1) Connect to your server via SSH. After logging in, you will see the VMBitrix menu. Enter ‘0’ to exit the menu.

2) Go to the project directory.
cd /home/bitrix/

3) Create a temporary directory for downloading the package and enter it.
mkdir tmp
cd tmp

Download the file into the tmp directory.
curl -sS https://getcomposer.org/installer | php

4) In my case, two errors occurred during installation.
4.1) mbstring.func_overload: change the value from ‘2’ to ‘0’.

4.2) Error message: ‘Some settings on your machine make Composer unable to work properly.
Make sure that you fix the issues listed below and run this script again:
The json extension is missing.
Install it or recompile php without --disable-phar"
The problem is that the phar extension is not enabled on the server. To enable it, open 20-phar.ini.
nano /etc/php.d/20-phar.ini

If nano is not installed on the server, run the following command.
sudo yum install -y nano
After installing nano, open the file and add the line ‘extension = phar.so’.

Then exit with Ctrl+X, save with Y and press Ctrl+X again.
5) Repeat the installation. The tmp directory should now contain composer.phar.

To make Composer available globally on the server, move the file to /usr/local/bin/ using this command.
mv composer.phar /usr/local/bin/composer

6) Remove the temporary tmp directory created earlier. First, leave tmp and return to its parent directory.
cd ..
Then remove the tmp directory.
rm -R tmp
Confirm by entering Y.

7) Done. Test the installation by running composer.
Back to blog

2) Go to the project directory.
cd /home/bitrix/

3) Create a temporary directory for downloading the package and enter it.
mkdir tmp
cd tmp

Download the file into the tmp directory.
curl -sS https://getcomposer.org/installer | php

4) In my case, two errors occurred during installation.
4.1) mbstring.func_overload: change the value from ‘2’ to ‘0’.

4.2) Error message: ‘Some settings on your machine make Composer unable to work properly.
Make sure that you fix the issues listed below and run this script again:
The json extension is missing.
Install it or recompile php without --disable-phar"
The problem is that the phar extension is not enabled on the server. To enable it, open 20-phar.ini.
nano /etc/php.d/20-phar.ini

If nano is not installed on the server, run the following command.
sudo yum install -y nano
After installing nano, open the file and add the line ‘extension = phar.so’.

Then exit with Ctrl+X, save with Y and press Ctrl+X again.
5) Repeat the installation. The tmp directory should now contain composer.phar.

To make Composer available globally on the server, move the file to /usr/local/bin/ using this command.
mv composer.phar /usr/local/bin/composer

6) Remove the temporary tmp directory created earlier. First, leave tmp and return to its parent directory.
cd ..
Then remove the tmp directory.
rm -R tmp
Confirm by entering Y.

7) Done. Test the installation by running composer.