Selected the second PHP version, but on the command line it's still the first

ErikR

Verified User
Joined
Aug 18, 2005
Messages
19
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:

Capture.PNG

Any ideas how to solve this?
 
Quich solution: Try compiling with the full path of the php binary - "/usr/local/php71/bin/php71" - instead of just "php".

Another solution: I guess in ~/.profile the users have something like that:

Code:
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:~/bin

The problem is that under /usr/local/bin there is a symlink of php to your first php release. You may think of a custom solution with the PATH inclusions for that user...
 
Back
Top