PHP 8.2 Support

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

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

+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:

PHP support #

  • For dynamic runtime selection, phpenv is available.
  • The following PHP versions are preinstalled:
alias version
8.1 8.1.2

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:

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

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

sudo apt-get install libonig5

Example of such a build is here Travis CI - Test and Deploy with Confidence

1 Like

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

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