This shows you the differences between two versions of the page.
— | kb:php:composer:00002 [2019/07/01 13:37] (current) – created gkuhnert@compassnetworks.com.au | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== How To Install and Use PHP Composer on BlueOnyx 5209R ====== | ||
+ | Ensure that you have met the following prerequisites before continuing with this tutorial: | ||
+ | |||
+ | * Logged in as a user with sudo privileges | ||
+ | * Have PHP 7 installed on your CentOS 7 system. | ||
+ | |||
+ | ===== Installing Composer on BlueOnyx ===== | ||
+ | |||
+ | The following steps describe how to install Composer on a BlueOnyx 5209R system. | ||
+ | |||
+ | ==== 1. Pre-requisites ==== | ||
+ | |||
+ | First install the PHP CLI (command line interface) package and all other dependencies with: | ||
+ | |||
+ | sudo yum install php-cli php-zip wget unzip | ||
+ | |||
+ | ==== 2. Get the installer ==== | ||
+ | |||
+ | Once PHP CLI is installed, download the Composer installer script with: | ||
+ | |||
+ | sudo php -d allow_url_fopen=1 -r " | ||
+ | |||
+ | ==== 3. Verify ==== | ||
+ | |||
+ | To verify the data integrity of the script compare the script SHA-384 hash with the latest installer hash found on the Composer Public Keys / Signatures page. | ||
+ | |||
+ | The following wget command will download the expected signature of the latest Composer installer from the Composer’s Github page and store it in a variable named HASH: | ||
+ | |||
+ | HASH=" | ||
+ | |||
+ | To verify that the installation script is not corrupted run the following command: | ||
+ | |||
+ | php -r "if (hash_file(' | ||
+ | |||
+ | If the hashes match, the following message will be shown: | ||
+ | Installer verified | ||
+ | |||
+ | |||
+ | If the hashes don’t match you will see Installer corrupt. In this case, you need to redownload the Composer installation script and double check the value of the $HASH variable with echo $HASH. Once the installer is verified, you can continue with the next step. | ||
+ | |||
+ | |||
+ | ==== 4. Install ==== | ||
+ | |||
+ | Run the following command to install Composer in the / | ||
+ | sudo php -d open_basedir= -d allow_url_fopen=1 composer-setup.php --install-dir=/ | ||
+ | |||
+ | ==== 5. Verify ==== | ||
+ | |||
+ | The last step is to verify the installation: | ||
+ | |||
+ | php -d open_basedir= / |