#1772

[Improvement]: Support PHP 8.5 in generated PHP builds

Opensudaneseopened 20d ago

Existing issue

  • I have searched the existing issues and found no duplicate.

This follows #937, which #1166 completed with PHP 8.3 and 8.4.

Current behavior

Generated PHP builds accept runtimeVersion 8.3 or 8.4 only. The list is PHP_VERSIONS = ["8.3", "8.4"] in packages/core/src/php-version.ts:5 (at 8cddb2675).

A runtime image override cannot reach 8.5 either:

  • resolvePhpImages rejects a dunglas/frankenphp:*-php8.5* runtimeImage when runtimeVersion is not 8.5 (php-version.ts:52-59).
  • runtimeVersion itself cannot be 8.5 (php-version.ts:32-36), so that check always fails for an 8.5 image.
  • For a custom image name, the recipe's version check stops the build when the image's PHP differs from the selected version (packages/adapters/src/runtime/docker-recipes/php.ts:59).

So an application that runs and tests on PHP 8.5 must either move to 8.4 on Openship or maintain its own Dockerfile.

Proposed improvement

Add "8.5" to PHP_VERSIONS and keep 8.4 as the default. phpImagePair then resolves the pair from the existing pattern:

  • build: php:8.5-cli-bookworm
  • runtime: dunglas/frankenphp:1-php8.5-bookworm

Both tags exist on Docker Hub. The dashboard picker reads the same list, so it needs no separate change. Two docs pages still name 8.3 and 8.4 (apps/web/content/docs/reference/openship-json.mdx:99, apps/web/content/docs/api/projects.mdx:67).

The tests from #1166 would gain an 8.5 case. Some tests use 8.5 as the unsupported example and would need another value (packages/core/src/runtime-version.test.ts:48, :79).

PHP 8.5 always builds OPcache into the PHP binary and always loads it. install-php-extensions should therefore skip opcache as already installed. An 8.5 build test would confirm that the shared extension line still passes.

PHP 8.6 is close. The PHP project plans 8.6.0 for 19 November 2026. The official images already publish 8.6-rc tags. FrankenPHP publishes no 8.6 image yet. The extension installer also does not list redis for 8.6. Could 8.6 join the list once both are available, in the same change or as a follow-up?

Benefits

  • Applications already on PHP 8.5 can use the generated recipe instead of a custom Dockerfile.
  • Existing projects do not change, because the default stays 8.4.
  • The selection, platform checks and rollback behaviour from #1166 apply unchanged.

Additional context

My case is a Laravel 13 application that runs PHP 8.5.12 in production and in its test suite.

Activity

2
Haswanthssch19d ago

Hi! I'd like to pick this up. Plan: add '8.5' to PHP_VERSIONS in packages/core/src/php-version.ts with 8.4 staying the default, handle the opcache skip for 8.5, update the two docs pages (openship-json.mdx and projects.mdx), and fix the tests that use 8.5 as the unsupported example. Is anyone already working on this?

sudanese18d ago

Thanks for picking this @Haswanthssch