Page MenuHomePhabricator

Method of switching PHP versions from Vagrant CLI
Open, LowestPublic

Description

Have method of switching PHP versions from the command line for testing purposes, e.g., switching between 5.3 and 5.4.


Version: unspecified
Severity: enhancement

Details

Reference
bz52303

Event Timeline

bzimport raised the priority of this task from to Needs Triage.
bzimport set Reference to bz52303.
bzimport added a subscriber: Unknown Object (MLST).

[mass-moving from Tools>MediaWiki-Vagrant to separate product. See bug 54041. Filter bugmail on this comment.]

Note: HHVM also kind of falls under the scope of this bug.

ori added a comment.Nov 25 2013, 10:08 AM

Setting aside Vagrant and Puppet for the moment: what is the proper way to specify the default PHP interpreter in Ubuntu?

apt-get allows you to specify the version of package to install. For example:

sudo apt-get install php5=5.5.3

Unfortunately it's only specific versions, meaning you can't do "php5>=5.4.9" or anything like that.

Also, you need to be using a version of Ubuntu that has the latest versions of PHP in the repository. (Only quantal and later have PHP 5.4, and only saucy has PHP 5.5.)

phpenv (https://github.com/phpenv/phpenv) provides an interesting way to install and manage multiple php interpreters. I have used it in the past to setup build and test servers for PECL extensions and other projects where having multiple php builds is useful. I think it's what Travis-CI uses as well to provide php matrix builds.

bd808 added a comment.Nov 17 2014, 9:35 PM

Bulk unassigning bugs from Ori.

bd808 triaged this task as Lowest priority.Dec 30 2014, 12:25 AM
hashar added a subscriber: hashar.Dec 21 2015, 3:48 PM

Semi-confusingly the version of phpenv at https://github.com/CHH/phpenv is the better version to use. The phpenv/phpenv version forked from the CHH version over "creative differences" and then stalled out in a not-quite-good state.

CI has the same need, T103786: Investigate installing php5.3 on trusty and/or debian instance.

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 21 2015, 3:48 PM
hashar added a subscriber: Legoktm.Feb 11 2016, 9:33 PM

@Legoktm solved it for CI via T126211 . Code included :)