# Using Composer in PHP 8.2

**URL:** <https://travis-ci.community/t/using-composer-in-php-8-2/13983>\
**Category:** PHP\
**Created:** [September 7, 2023, 3:24pm UTC](https://travis-ci.community/t/using-composer-in-php-8-2/13983 "2023-09-07T15:24:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![devinsays](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/devinsays/32/8896_2.png) [@devinsays](https://travis-ci.community/u/devinsays)\
**Post date:** [September 7, 2023, 3:24pm UTC](https://travis-ci.community/t/using-composer-in-php-8-2/13983/1 "2023-09-07T15:24:18Z")

</div>

I am getting this error when attempting to run tests in PHP 8.2:

```auto
0.02s$ phpenv global 8.2 2>/dev/null
8.2 is not pre-installed; installing
Downloading archive: https://storage.googleapis.com/travis-ci-language-archives/php/binaries/ubuntu/16.04/x86_64/php-8.2.tar.bz2
0.27s$ curl -sSf --retry 5 -o archive.tar.bz2 $archive_url && tar xjf archive.tar.bz2 --directory /
0.00s0.01s$ phpenv global 8.2
rbenv: composer: command not found
The `composer' command exists in these PHP versions:
  7.4
  7.4.30
  hhvm
  hhvm-stable

```

Anyone know how I can get Composer to run properly in 8.2?

Here’s my .yml file:

```auto
language: php
dist: xenial

services:
  - mysql

notifications:
  email:
    on_success: never
    on_failure: change

cache:
  directories:
    - $HOME/.composer/cache

matrix:
  fast_finish: true
  include:
    # Test select combinations with different dependencies.
    # To test with the latest WordPress version, use WP_VERSION=latest
    # - name: Current Versions
    # php: 8.0
    # env: WP_VERSION=6.3 WC_VERSION=7.8.1
    - name: Next Version
      php: 8.2
      env: WP_VERSION=6.3 WC_VERSION=7.8.1

  allow_failures:
    - name: Bleeding Edge

before_install:
  - export PATH="$HOME/.composer/vendor/bin:$PATH"
  - phpenv config-rm xdebug.ini || true

install:
  - composer install --prefer-source --no-interaction --no-ansi
  - bash tests/bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
  - cd wp-content/mu-plugins/example && composer install && composer dumpautoload -o

script:
  - ./vendor/bin/phpunit

```

---

<div class="post-metadata">

**Author:** ![devinsays](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/devinsays/32/8896_2.png) [@devinsays](https://travis-ci.community/u/devinsays)\
**Post date:** [September 8, 2023, 4:58pm UTC](https://travis-ci.community/t/using-composer-in-php-8-2/13983/2 "2023-09-08T16:58:55Z")

</div>

Follow up: Switching from the `xenial` distribution to `jammy` resolved this.

```auto
language: php
dist: jammy

```
