Get the installation directory for PHP
Use Find/-name php.ini to see where PHP is installed
/usr/local/php/lib/php.ini
# CD to/usr/local/php/lib/php.ini directory, view php file permissions
LS-Ltotal59464-rwxr-xr-x1Root root837Jan to 2018Pear-rwxr-xr-x1Root root858Jan to 2018Peardev-rwxr-xr-x1Root root774Jan to 2018pecllrwxrwxrwx1Root root9Jan to 2018PharPhar.phar-rwxr-xr-x1Root root53494Jan to 2018Phar.phar-rwxr-xr-x1Root root30458256Jan to 2018PHP-rwxr-xr-x1Root root30345152Jan to 2018php-CGI-rwxr-xr-x1Root root2382Jan to 2018php-Config-rwxr-xr-x1Root root4538Jan to 2018Phpize
Setting environment Variables for PHP
First look at the current environment variables
Echo $PATH
#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
Here we see that there is no PHP, so we add PHP in
Export path= $PATH:/usr/local/php/bin
View all environment variables using the Echo $PATH
:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/php/bin
Test at any location using PHP commands
php- version 5.6. - to 2018 All:1997-the PHP groupzend Engine v2. 6.0 1998- Zend Technologies
Install global composer
# This command is used to download a Composer.phar file
Curl-ss https://Getcomposer.org/installer | php
The installation succeeds as follows
Global Use composer command, Composer.phar move into bin
MV Composer.phar/usr/local/bin/composer
Troubleshoot Linux using PHP commands-base Comment not found and install composer