Composer for PHP is an increasingly popular tool for managing packages within a PHP application. Here’s a link for more information:
On many of our Plesk servers we have multiple PHP versions install. The default at /usr/bin/php is provided by the Linux distribution and then there are additional version installed at /opt/plesk/php. Plesk lets us easily select the PHP version for each hosted website. But you can run into problems with composer using the wrong PHP version. A typical composer command might be:
1 |
php composer.phar install |
or
1 |
php composer.phar update |
To make our alternate PHP version work we need to instead do something like this:
1 |
export PATH=/opt/plesk/php/5.6/bin:$PATH; php composer.phar update |
So we override the default PHP by adding our preferred version to the front of the path.