# The command "phpenv global" failed and exited with 1 during

**URL:** <https://travis-ci.community/t/the-command-phpenv-global-failed-and-exited-with-1-during/2307>\
**Category:** PHP\
**Created:** [February 15, 2019, 5:33pm UTC](https://travis-ci.community/t/the-command-phpenv-global-failed-and-exited-with-1-during/2307 "2019-02-15T17:33:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![driesvints](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/driesvints/32/3360_2.png) [@driesvints](https://travis-ci.community/u/driesvints)\
**Post date:** [February 15, 2019, 5:33pm UTC](https://travis-ci.community/t/the-command-phpenv-global-failed-and-exited-with-1-during/2307/1 "2019-02-15T17:33:35Z")

</div>

Since about a month (or even longer) I’ve been seeing lots of builds which fail because they can’t install a certain PHP version. Take for example the following build: [Travis CI - Test and Deploy with Confidence](https://travis-ci.org/laravel/framework/jobs/492257840)

You’ll see that because 7.3 isn’t pre-installed it starts downloading and installing. Then I get a curl error:

> curl: (56) GnuTLS recv error (-54): Error in the pull function.

And because of that phpenv can’t select the correct php version:

> rbenv: version `7.3’ not installed  
> The command “phpenv global 7.3” failed and exited with 1 during .

This is a bit annoying as there’s nothing wrong except that Travis fails to download a certain PHP version and then fails because of that.

Maybe a solution would be to retry when a curl error happens? But then it would have to wait quite a while. I think investigation into why Travis can’t download these versions sometimes is a better way to go.

---

<div class="post-metadata">

**Author:** ![driesvints](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/driesvints/32/3360_2.png) [@driesvints](https://travis-ci.community/u/driesvints)\
**Post date:** [February 18, 2019, 10:00am UTC](https://travis-ci.community/t/the-command-phpenv-global-failed-and-exited-with-1-during/2307/2 "2019-02-18T10:00:58Z")

</div>

Seems like answer was posted on a different issue here: [Running phpenv runs rbenv instead](https://travis-ci.community/t/running-phpenv-runs-rbenv-instead/1851/3)

---

<div class="post-metadata">

**Author:** ![driesvints](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/driesvints/32/3360_2.png) [@driesvints](https://travis-ci.community/u/driesvints)\
**Post date:** [February 18, 2019, 10:02am UTC](https://travis-ci.community/t/the-command-phpenv-global-failed-and-exited-with-1-during/2307/3 "2019-02-18T10:02:03Z")

</div>

Actually, it’s not since that answer only specifies 7.1 while the issue happens for 7.1, 7.2 & 7.3.

---

<div class="post-metadata">

**Author:** ![dominic](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/dominic/32/14_2.png) [@dominic](https://travis-ci.community/u/dominic)\
**Post date:** [February 18, 2019, 12:13pm UTC](https://travis-ci.community/t/the-command-phpenv-global-failed-and-exited-with-1-during/2307/4 "2019-02-18T12:13:35Z")

</div>

@driesvints Sorry for the troubles you are having with your builds while downloading PHP archives.

We have shipped an improvement last Friday where language archives are now pulled from a CDN instead of from AWS S3. Could you let me know if this happened again since then? Please post links to newer builds if this is the case and we’ll be happy to have a look.

Thanks!

---

<div class="post-metadata">

**Author:** ![driesvints](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/driesvints/32/3360_2.png) [@driesvints](https://travis-ci.community/u/driesvints)\
**Post date:** [February 18, 2019, 12:58pm UTC](https://travis-ci.community/t/the-command-phpenv-global-failed-and-exited-with-1-during/2307/5 "2019-02-18T12:58:07Z")

</div>

Hey Dominic. There haven’t been any failing builds with this problem since. Thanks a lot for looking into this!

---

<div class="post-metadata">

**Author:** ![dominic](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/dominic/32/14_2.png) [@dominic](https://travis-ci.community/u/dominic)\
**Post date:** [February 18, 2019, 1:29pm UTC](https://travis-ci.community/t/the-command-phpenv-global-failed-and-exited-with-1-during/2307/6 "2019-02-18T13:29:14Z")

</div>

Great news! Please create a new post if it happens again. Happy building!

---

<div class="post-metadata">

**Author:** ![dominic](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/dominic/32/14_2.png) [@dominic](https://travis-ci.community/u/dominic)\
**Post date:** [February 18, 2019, 1:29pm UTC](https://travis-ci.community/t/the-command-phpenv-global-failed-and-exited-with-1-during/2307/7 "2019-02-18T13:29:18Z")

</div>


