# PHP 8.2 Support

**URL:** <https://travis-ci.community/t/php-8-2-support/13401>\
**Category:** Environments\
**Tags:** php\
**Created:** [November 7, 2022, 12:30pm UTC](https://travis-ci.community/t/php-8-2-support/13401 "2022-11-07T12:30:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![geega](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/geega/32/7062_2.png) [@geega](https://travis-ci.community/u/geega)\
**Post date:** [November 7, 2022, 12:30pm UTC](https://travis-ci.community/t/php-8-2-support/13401/1 "2022-11-07T12:30:05Z")

</div>

How to correctly enable PHP 8.2 support for compatibility testing in phpenv because got error?

```auto
$ phpenv global 8.2
696rbenv: version `8.2' not installed
697The command "phpenv global 8.2" failed and exited with 1 during .

```

---

<div class="post-metadata">

**Author:** ![elb98rm](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/elb98rm/32/6500_2.png) [@elb98rm](https://travis-ci.community/u/elb98rm)\
**Post date:** [December 14, 2022, 10:40pm UTC](https://travis-ci.community/t/php-8-2-support/13401/2 "2022-12-14T22:40:11Z")

</div>

+1 for this question.

In the documentation, it implies we can run installs/choose options, but then doesn’t give much more info.

One of the key points of using Travis for my organisation is being able to spin up software upgrades without using the server. Really we’d like to track php’s release schedule. It took quite some time for the images to be updated last time.

How would you select this using `phpenv` (or whatever you’d recommend).

Documentation example:

> **[Travis CI Documentation](https://docs.travis-ci.com/user/reference/jammy/#php-support)**
>
> The Ubuntu 22.04 (Jammy Jellyfish) Build Environment

## PHP support [#](https://docs.travis-ci.com/user/reference/jammy/#php-support)

- For dynamic runtime selection, `phpenv` is available.
- The following PHP versions are preinstalled:

| alias | version |
| --- | --- |
| `8.1` | `8.1.2` |

---

<div class="post-metadata">

**Author:** ![slunak](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/slunak/32/8415_2.png) [@slunak](https://travis-ci.community/u/slunak)\
**Post date:** [December 31, 2022, 9:19am UTC](https://travis-ci.community/t/php-8-2-support/13401/3 "2022-12-31T09:19:33Z")

</div>

PHP 8.2 is now available, but only on focal dist as far I can see. Switching to it with `phpenv global 8.2` gives error:

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

```

Same for `composer self-update` etc.

`composer install` fails and tests obviously fail. Example of asuch build is here [Travis CI - Test and Deploy with Confidence](https://app.travis-ci.com/github/slunak/pushover-php/jobs/592257747)

Installing the missing library fixes the tests but does not fix environment buuilding errors:

```auto
sudo apt-get install libonig5

```

Example of such a build is here [Travis CI - Test and Deploy with Confidence](https://app.travis-ci.com/github/slunak/pushover-php/jobs/592258405)

---

<div class="post-metadata">

**Author:** ![jmckenna](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/jmckenna/32/8023_2.png) [@jmckenna](https://travis-ci.community/u/jmckenna)\
**Post date:** [January 10, 2023, 8:28pm UTC](https://travis-ci.community/t/php-8-2-support/13401/4 "2023-01-10T20:28:28Z")

</div>

Thanks @slunak, I am hitting your exact situation, with Focal.

---

<div class="post-metadata">

**Author:** ![szepeviktor](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/szepeviktor/32/819_2.png) [@szepeviktor](https://travis-ci.community/u/szepeviktor)\
**Post date:** [April 14, 2023, 7:45pm UTC](https://travis-ci.community/t/php-8-2-support/13401/5 "2023-04-14T19:45:13Z")

</div>

Using Travis’ built-in apt support is the solution.  
Please see [Run CI on PHP 8.2 too by szepeviktor · Pull Request #8 · szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset · GitHub](https://github.com/szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset/pull/8/files)
