PHP: Locate installation Directory
php --ini
<?php phpinfo(); ?>
<?php
// prints e.g. 'Current PHP version: 4.1.1'
echo 'Current PHP version: ' . phpversion();
?>
If you are using the PHP CLI, then try using theese shell commands (i'm assuming that you are using linux here)
which php - will locate the php executable (this should be the default php used by you)
whereis php - The first path displayed will be the location of the php executable
echo $PATH - will print a list of paths separated by ":" where the system looks for commands
composer.json
composer.phar