PHP 8.1 support

The default build options seem to not have php8.1 support:

language: php

php:
  - '8.1'
  - '8.0'
  - '7.4'
  - '7.3'

This produces the following error output;

Setting environment variables from .travis.yml
$ export XDEBUG_MODE=coverage
0.02s$ phpenv global 8.1 2>/dev/null
8.1 is not pre-installed; installing
Downloading archive: https://storage.googleapis.com/travis-ci-language-archives/php/binaries/ubuntu/16.04/x86_64/php-8.1.tar.bz2
0.10s$ curl -sSf --retry 5 -o archive.tar.bz2 $archive_url && tar xjf archive.tar.bz2 --directory /
curl: (22) The requested URL returned error: 404 Not Found
0.00s0.01s$ phpenv global 8.1
rbenv: version `8.1' not installed
The command "phpenv global 8.1" failed and exited with 1 during .
Your build has been stopped.

Here is an example build:
https://app.travis-ci.com/github/floor9design-ltd/test-data-generator/jobs/550979806

This could be a number of issues as it’s a new release. Is there an eta on a fix?

Thanks

Hey @elb98rm,

PHP 8.1 is not supported right now, nightly will bring back:

PHP 8.0.0-dev (cli) (built: Jan 7 2020 22:28:03) (ZTS)

I made sure of this using the nightly build with these settings:

language: php
php:
  - nightly
 
dist:
  - trusty

install: skip
script: php --version

I’ll ask internally to see when this is going to be integrated, and have more of a solid answer for you.

3 Likes

Ah thanks @Montana,

Was looking for a binary answer.

A colleague and I are going to investigate this further tomorrow. Thanks again folks.

2 Likes

@Montana - any updates? PHP 8.1 was released almost two weeks ago. styleci.io already supports it. Not sure about GitHub Actions or other CI providers…

Hey @terrafrost,

Jobs using PHP 8.1.0 should work now.

Not for me: just ran a build:

https://app.travis-ci.com/github/floor9design-ltd/test-data-generator/jobs/551463996

0.02s$ phpenv global 8.1 2>/dev/null
8.1 is not pre-installed; installing
Downloading archive: https://storage.googleapis.com/travis-ci-language-archives/php/binaries/ubuntu/16.04/x86_64/php-8.1.tar.bz2
0.11s$ curl -sSf --retry 5 -o archive.tar.bz2 $archive_url && tar xjf archive.tar.bz2 --directory /
curl: (22) The requested URL returned error: 404 Not Found
0.00s0.01s$ phpenv global 8.1
rbenv: version `8.1' not installed
The command "phpenv global 8.1" failed and exited with 1 during .
Your build has been stopped.

It’s not working for me either. I tried adding - 8.1.0 to my .travis.yml and got this:

$ phpenv global 8.1.0 2>/dev/null
8.1.0 is not pre-installed; installing
Downloading archive: https://storage.googleapis.com/travis-ci-language-archives/php/binaries/ubuntu/16.04/x86_64/php-8.1.0.tar.bz2
9.57s$ curl -sSf --retry 5 -o archive.tar.bz2 $archive_url && tar xjf archive.tar.bz2 --directory /
0.01s0.02s$ phpenv global 8.1.0
php: error while loading shared libraries: libargon2.so.1: cannot open shared object file: No such file or directory
0.04s$ composer self-update
php: error while loading shared libraries: libargon2.so.1: cannot open shared object file: No such file or directory
$ php --version
php: error while loading shared libraries: libargon2.so.1: cannot open shared object file: No such file or directory
$ composer --version
php: error while loading shared libraries: libargon2.so.1: cannot open shared object file: No such file or directory

Source: Travis CI - Test and Deploy with Confidence

I also tried doing - 8.1 to my .travis.yml:

$ phpenv global 8.1 2>/dev/null
8.1 is not pre-installed; installing
Downloading archive: https://storage.googleapis.com/travis-ci-language-archives/php/binaries/ubuntu/16.04/x86_64/php-8.1.tar.bz2
0.10s$ curl -sSf --retry 5 -o archive.tar.bz2 $archive_url && tar xjf archive.tar.bz2 --directory /
curl: (22) The requested URL returned error: 404 Not Found
0.00s0.02s$ phpenv global 8.1
rbenv: version `8.1' not installed
The command "phpenv global 8.1" failed and exited with 1 during .

Source: Travis CI - Test and Deploy with Confidence

I mean, I feel like 8.1 ought to work since 8.0, 7.4, 7.3, 7.2, 7.1, 7.0, etc, all work. Using 8.1.0 works more than 8.1 works but it doesn’t seem to really be working either…

I’m using xenial (16.04) as my dist.

8.1.0 works on bionic (18.04)!

I still think 8.1 ought to work as well. Either copy https://storage.googleapis.com/travis-ci-language-archives/php/binaries/ubuntu/18.04/x86_64/php-8.1.0.tar.bz2 to https://storage.googleapis.com/travis-ci-language-archives/php/binaries/ubuntu/18.04/x86_64/php-8.1.tar.bz2 or make the latter a symlink of the former.

Under this .travis.yml I just made, 8.1 works as well:

addons:
  apt:
    packages: null
    sources:
      - sourceline: 'ppa:ondrej/php'
    update: true
before_install:
  - sudo apt update
  - sudo apt-get -y install libxml2-dev
  - >-
    sudo apt install -y lsb-release ca-certificates apt-transport-https
    software-properties-common gnupg2
  - 'wget -qO - https://packages.sury.org/php/apt.gpg | sudo apt-key add -'
dist: focal
install:
  - sudo apt install php8.1
  - sudo update-alternatives --set php /usr/bin/php8.1 
language: generic

I will still bring this up again with the internal team, and will go over this as soon as possible.

2 Likes

Hey @montana,

Your configuration works, is there any word on when it will be officially in a changelog or something? Thanks for this by the way, I can work with it for now…

PHP8.1.0 is available built-in on the images [1] as well.

Thanks,

[1] Travis CI - Test and Deploy with Confidence

I’ve tried the following and both don’t work:

php:
  - '8.1'
  - '8.0'
  - '7.4'
  - '7.3'

as well as:

php:
  - '8.1.0'
  - '8.0'
  - '7.4'
  - '7.3'

https://app.travis-ci.com/github/floor9design-ltd/test-data-generator/jobs/551524679

@elb98rm - does adding dist: bionic between language: and php: help?

Setting environment variables from .travis.yml
$ export XDEBUG_MODE=coverage
0.01s$ phpenv global 8.1 2>/dev/null
8.1 is not pre-installed; installing
Downloading archive: https://storage.googleapis.com/travis-ci-language-archives/php/binaries/ubuntu/18.04/x86_64/php-8.1.tar.bz2
NaNs$ curl -sSf --retry 5 -o archive.tar.bz2 $archive_url && tar xjf archive.tar.bz2 --directory /
curl: (22) The requested URL returned error: 404 
0.00s0.01s$ phpenv global 8.1
rbenv: version `8.1' not installed
The command "phpenv global 8.1" failed and exited with 1 during .
Your build has been stopped.

Nope!

I had to do 8.1.0 - not 8.1.

I do think they ought to make it so that 8.1 works but whatever

2 Likes

Ok, that works. Thanks for the workaround.

Can we get an update when this will be possible without the non-default specifications? i.e:

language: php
php:
  - '8.1'
  - '8.0'
  - '7.4'
  - '7.3'
3 Likes

I’ve having the same error while using php 8.1.0 on ubuntu xenial (16.04) : Travis CI - Test and Deploy with Confidence

$ phpenv global 8.1.0 2>/dev/null
8.1.0 is not pre-installed; installing
Downloading archive: https://storage.googleapis.com/travis-ci-language-archives/php/binaries/ubuntu/16.04/x86_64/php-8.1.0.tar.bz2
14.77s$ curl -sSf --retry 5 -o archive.tar.bz2 $archive_url && tar xjf archive.tar.bz2 --directory /
0.01s0.02s$ phpenv global 8.1.0
php: error while loading shared libraries: libargon2.so.1: cannot open shared object file: No such file or directory
0.06s$ composer self-update
php: error while loading shared libraries: libargon2.so.1: cannot open shared object file: No such file or directory
$ php --version
php: error while loading shared libraries: libargon2.so.1: cannot open shared object file: No such file or directory
$ composer --version
php: error while loading shared libraries: libargon2.so.1: cannot open shared object file: No such file or directory

Same issue here.

0.01s0.03s$ phpenv global 8.1 2>/dev/null
8.1 is not pre-installed; installing
Downloading archive: https://storage.googleapis.com/travis-ci-language-archives/php/binaries/ubuntu/18.04/x86_64/php-8.1.tar.bz2
0.07s$ curl -sSf --retry 5 -o archive.tar.bz2 $archive_url && tar xjf archive.tar.bz2 --directory /
curl: (22) The requested URL returned error: 404 
0.00s0.03s$ phpenv global 8.1
rbenv: version `8.1' not installed
The command "phpenv global 8.1" failed and exited with 1 during .

Your build has been stopped.

@rtrzebinski,

Did you define the PHP version as:

8.1.0 or 8.1?