Action failed: set php version to 5.6.14

Recently, when building a php project with CircleCI, I get this error message:

rbenv: version `5.6.14’ not installed
((phpenv global “5.6.14”)) returned exit code 1((phpenv global “5.6.14”)) returned exit code 1
Action failed: set php version to 5.6.14

However, I saw in docs that 5.6.14 is supported by CircleCI… do you know what’s happening?

Thanks

1 Like

Hi,

Which container are you using, Precise (the default) or Trusty? Also will you be willing to share your circle.yml file? Or at least the machine section of it?

I tried with both Precise and Trusty, this is my circle.yml:

Same issue here for Trusty. It works fine with 12.04, but that uses PHP 5.3 for CLI and we need a more recent PHP version that supports shorthand array syntax [].

When using Trusty we get this:

rbenv: version `5.6.14’ not installed
((phpenv global “5.6.14”)) returned exit code 1
Action failed: set php version to 5.6.14

@pensiero Based on that circle.yml file I’m not sure. You said you tried both Precise and Trusty. On Trusty this shouldn’t work (see below) but should on Precise. Were you switching between the two? If so, did you try PHP 5.6.14 by sending GitHub a new commit or rebuilding? Retrying, rebuilding, or even scheduled builds will remain on the same container it was before.

Otherwise, I’m not 100% what’s going on. Did this just start?

@renedekat PHP 5.6.14 is not available on Trusty. You can find the versions preinstalled here: https://circleci.com/docs/trusty-image/

EDIT: Using sudo before PHP changes which version you are using. Most likely, you don’t need to use sudo.

1 Like

@FelicianoTech Thanks! I solved my issue. Turns out that when using “sudo php” the default php 5.3 is used.

1 Like

Thanks, with 5.6.17 and Trusty it works :slight_smile:

1 Like

Great to hear guys! :build_success:

Hey guys, I know this is an old thread, but I’ve had this exact problem.

In your case, the solution was to remove sudo because you didn’t need it. But in my case, I do need it!
The PHP that I’m trying to run creates new files in the $CIRCLE_ARTIFACTS folder.

Without sudo, this fails with a permissions error. With sudo it fails because of the [] syntax.

Is there any way I can affect the version of php that the sudo user is using?

Thanks!