Reputation: 1117
I have installed 2 PHP version in my DirectAdmin environment: php5.5 (php1_release) and php7.1 (php2_release). Now I have one user set to php 7.1 with the PHP Versions Selector under Domain Setup. On the website in the browser it seems to work well, phpinfo tells me that php7.1 is running for this domain. But when I use composer from the command line it gives an error because it detects php5.5:
Any ideas how to solve this?
Upvotes: 0
Views: 1299
Reputation: 799
In certain cases, I would rather utilize the actual path installation of Composer to avoid encountering the "composer command not found" issue.
/usr/local/php82/bin/php82 /usr/local/bin/composer install
Could be rewritten as:
/usr/local/php82/bin/php82 $(which composer) install
This alternative command utilizes the which
command to locate the path of the Composer executable, allowing you to use the real Composer installation path and avoid any "command not found" problems.
Upvotes: 0
Reputation: 3957
Try compiling with the full path of the php
binary - "/usr/local/php70/bin/php70"
- instead of just "php"
. Now command will be like that.
/usr/local/php70/bin/php70 composer.phar update
Important note : PHP binary Path will be different for each server.
Upvotes: 1