Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP8.2 is missing from the Ubuntu 22 runner image #7545

Closed
2 of 10 tasks
CxDevLead opened this issue May 7, 2023 · 4 comments
Closed
2 of 10 tasks

PHP8.2 is missing from the Ubuntu 22 runner image #7545

CxDevLead opened this issue May 7, 2023 · 4 comments

Comments

@CxDevLead
Copy link

Description

As of currently, if a user needs to use PHP8.2 on a Microsoft hosted runner image, the only option they have is Ubuntu 20.

Ubuntu 22 should also support the most recent version of PHP.

Platforms affected

  • Azure DevOps
  • GitHub Actions - Standard Runners
  • GitHub Actions - Larger Runners

Runner images affected

  • Ubuntu 20.04
  • Ubuntu 22.04
  • macOS 11
  • macOS 12
  • macOS 13
  • Windows Server 2019
  • Windows Server 2022

Image version and build link

20230426.1

Is it regression?

No

Expected behavior

PHP8.2 is included as a supported version in the runner image

Actual behavior

PHP 8.2 is not supported, and any PHP8.2 features (such as readonly classes) fail.

Repro steps

Use the following settings:

pool:
  vmImage: 'ubuntu-latest'

variables:
  phpVersion: 8.2

steps:
  # First, update the phpVersion to the required version
  - script: |
      sudo update-alternatives --set php /usr/bin/php$(phpVersion)
      sudo update-alternatives --set phar /usr/bin/phar$(phpVersion)
      sudo update-alternatives --set phpdbg /usr/bin/phpdbg$(phpVersion)
      sudo update-alternatives --set php-cgi /usr/bin/php-cgi$(phpVersion)
      sudo update-alternatives --set phar.phar /usr/bin/phar.phar$(phpVersion)
      php -version
    displayName: 'Use PHP version $(phpVersion)'

The runner will throw the following errors:

update-alternatives: error: alternative /usr/bin/php8.2 for php not registered; not setting
update-alternatives: error: alternative /usr/bin/phar8.2 for phar not registered; not setting
update-alternatives: error: alternative /usr/bin/phpdbg8.2 for phpdbg not registered; not setting
update-alternatives: error: alternative /usr/bin/php-cgi8.2 for php-cgi not registered; not setting
update-alternatives: error: alternative /usr/bin/phar.phar8.2 for phar.phar not registered; not setting
PHP 8.1.2-1ubuntu2.11 (cli) (built: Feb 22 2023 22:56:18) (NTS)
@sergei-pyshnoi
Copy link
Contributor

Hello @CxDevLead , we will take a look.

@sergei-pyshnoi
Copy link
Contributor

PHP 8.2 Is missing in official Ubuntu22 apt repository. GitHub recommends using the setup-php action for any customers who want to use any other (non-installed) versions of PHP or want to get latest PHP faster. You can find additional information in this tread.

@CxDevLead
Copy link
Author

I doubt any PHP developer considers this closed or a solution.

Canonical only supports 1 version of PHP for every Ubuntu release. Once a new version is released they do not include it until the next release.

@ilia-shipitsin
Copy link
Contributor

@CxDevLead , maybe switching to containerized builds is an option ?

for example

name: CI

on: [ push, workflow_dispatch ]

jobs:
  build:
    runs-on: ubuntu-latest
    container:
      image: php:${{ matrix.php_version }}
    strategy:
      matrix:
        php_version: ["8.2", "8.1"]
        
    steps:
      - uses: actions/checkout@v3

      - name: Run a one-line script
        run: php --version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants