6 posts / 0 new
Last post
#1 Tue, 08/02/2016 - 09:35
n3rden

composer

Good afternoon,

I have a virtualmin server running multiple versions of PHP

/etc/php.ini Global PHP configuration   (5.3)
  /opt/rh/php54/root/etc/php.ini PHP 5.4
  /opt/rh/php55/root/etc/php.ini PHP 5.5

Website.domain.com is set to PHP 5.5, a phpinfo file confirms this.

if i login as the Website.domain.com user and run

#php -v

it shows as 5.3.3 in the interpreter

># /opt/rh/php55/root/usr/bin/php -v

shows 5.5.21 as the interpreter

I am trying to run

># composer update

and its failing due to dependencies and incompatibility with the PHP 5.3.3

Has anyone seen this before or does anyone have a work around?

Thanks in advance,

Tue, 08/02/2016 - 10:18
andreychek

Howdy,

I'm unfortunately not familiar with composer, but it's likely trying to use the default version of PHP located in /usr/sbin.

You may need to determine how it's calling PHP, and modify it so that it's pointing to your preferred PHP version. That all may unfortunately mean changing the composer file itself.

Eric

Tue, 08/02/2016 - 11:00
n3rden

Thanks Andrey, That was about as far as I got too. Ive tried adding an alias to Website.domain.com's ./bash_profile for the php55 version of php. but that didnt help when running the composer update command

Tue, 08/02/2016 - 18:47
cruiskeen

you should just have to have the correct PHP executable in your path - so you can probably either

scl enable php55

or

set your path to have /opt/rh/php55/root/bin at the beginning of your path variable.

Wed, 08/03/2016 - 05:12
n3rden

In the event someone has the same problem, the solution was to log in as the website.domain.com user and run

scl enable php55 bash

This user's cli version of PHP is now the PHP55 build, no other user is affected, most importantly my composer update now works

Sat, 10/28/2017 - 11:58
ladhani

update to enable php7 in CLI:

scl enable rh-php70 bash

Topic locked