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

**URL:** <https://travis-ci.community/t/the-command-phpenv-global-8-1-failed-and-exited-with-1/12533>\
**Category:** PHP\
**Created:** [December 23, 2021, 7:55am UTC](https://travis-ci.community/t/the-command-phpenv-global-8-1-failed-and-exited-with-1/12533 "2021-12-23T07:55:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nbayramberdiyev](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/nbayramberdiyev/32/7539_2.png) [@nbayramberdiyev](https://travis-ci.community/u/nbayramberdiyev)\
**Post date:** [December 23, 2021, 7:55am UTC](https://travis-ci.community/t/the-command-phpenv-global-8-1-failed-and-exited-with-1/12533/1 "2021-12-23T07:55:52Z")

</div>

PHP 8.1 build fails because of the following error:

```auto
curl: (22) The requested URL returned error: 404 Not Found

```

As you can see [in this job](https://app.travis-ci.com/github/nbayramberdiyev/psr7-server/jobs/553360164), PHP 8.1 is not pre-installed, so it starts downloading and then gets curl error.

Why is this happening?

Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![Montana](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/montana/32/9566_2.png) [@Montana](https://travis-ci.community/u/Montana)\
**Post date:** [December 23, 2021, 6:37pm UTC](https://travis-ci.community/t/the-command-phpenv-global-8-1-failed-and-exited-with-1/12533/2 "2021-12-23T18:37:39Z")

</div>

Try using `8.1.0` as the version if you’re trying to use PHP 8.1, here’s an example `.travis.yml` I’ve created:

```auto
language: php
dist: bionic
php:
  - '8.1.0'
  - '8.0'
  - '7.4'
  - '7.3'
  
install: skip 
script: skip

```

Here’s the repository for the successful build:

> <https://github.com/Montana/travis-php8-test/blob/master/.travis.yml>

---

<div class="post-metadata">

**Author:** ![nbayramberdiyev](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/nbayramberdiyev/32/7539_2.png) [@nbayramberdiyev](https://travis-ci.community/u/nbayramberdiyev)\
**Post date:** [December 23, 2021, 6:50pm UTC](https://travis-ci.community/t/the-command-phpenv-global-8-1-failed-and-exited-with-1/12533/3 "2021-12-23T18:50:21Z")

</div>

Thanks! But it still fails with the following error:

```auto
php: error while loading shared libraries: libargon2.so.1: cannot open shared object file: No such file or directory

```

[Here](https://app.travis-ci.com/github/nbayramberdiyev/psr7-server/jobs/553436152) is the logs.

---

<div class="post-metadata">

**Author:** ![Montana](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/montana/32/9566_2.png) [@Montana](https://travis-ci.community/u/Montana)\
**Post date:** [December 23, 2021, 7:04pm UTC](https://travis-ci.community/t/the-command-phpenv-global-8-1-failed-and-exited-with-1/12533/4 "2021-12-23T19:04:52Z")

</div>

Hey @nbayramberdiyev,

Glossing over your `.travis.yml`, it’s a bit inconsistent, so what I’ve done is fixed some of the inconsistencies I saw and let’s see if that allows it to build if not, I’ll focus on `argon` and do a deep dive into that.

Below is your `.travis.yml` that I refactored:

```auto
language: php
os:
  - linux
dist: bionic
sudo: false
cache:
  directories:
    - $HOME/.composer/cache
php:
  - '7.4'
  - '8.0'
  - '8.1.0'
env:
  global:
    - TEST_COMMAND: '"composer test"'
branches:
  except:
    - /^analysis-.*$/
before_install:
  - >-
    if ! [-v "$DEPENDENCIES"]; then composer require --no-update
    ${DEPENDENCIES}; fi;
install:
  - 'composer update ${COMPOSER_FLAGS} --prefer-source --no-interaction'
script:
  - $TEST_COMMAND
after_success:
  - >-
    if [["$COVERAGE" = true]]; then wget
    https://scrutinizer-ci.com/ocular.phar; fi
  - >-
    if [["$COVERAGE" = true]]; then php ocular.phar code-coverage:upload
    --format=php-clover build/coverage.xml; fi
jobs:
  fast_finish: true
  allow_failures:
    - php: nightly
  include:
    - php: '8.1.0'
      name: Backward compatibillity check
      env:
        - DEPENDENCIES: '"roave/backward-compatibility-check"'
          TEST_COMMAND: '"./vendor/bin/roave-backward-compatibility-check"'
    - php: '7.4'
      name: Lowest version of dependencies
      env:
        - COMPOSER_FLAGS: '"--prefer-stable --prefer-lowest"'
          COVERAGE: 'true'
          TEST_COMMAND: '"composer test-ci"'

```

---

<div class="post-metadata">

**Author:** ![nbayramberdiyev](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/nbayramberdiyev/32/7539_2.png) [@nbayramberdiyev](https://travis-ci.community/u/nbayramberdiyev)\
**Post date:** [December 23, 2021, 9:44pm UTC](https://travis-ci.community/t/the-command-phpenv-global-8-1-failed-and-exited-with-1/12533/5 "2021-12-23T21:44:58Z")

</div>

After specifying `dist: bionic`, the error is disappeared. Thank you!

---

<div class="post-metadata">

**Author:** ![Montana](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/montana/32/9566_2.png) [@Montana](https://travis-ci.community/u/Montana)\
**Post date:** [December 23, 2021, 10:17pm UTC](https://travis-ci.community/t/the-command-phpenv-global-8-1-failed-and-exited-with-1/12533/6 "2021-12-23T22:17:39Z")

</div>

Great to hear, glad I could help you solve your problem.
