Skip to content

test: pass on PHP builds without OPcache loaded - #2828

Merged
dunglas merged 2 commits into
mainfrom
claude/fix-php83-tests-24778d
Nov 9, 2026
Merged

dunglas merged 2 commits into
mainfrom
claude/fix-php83-tests-24778d

Conversation

@dunglas

@dunglas dunglas commented Nov 9, 2026

Copy link
Copy Markdown
Member

On PHP < 8.5, OPcache is a shared extension by default. A build that follows https://frankenphp.dev/docs/compile/ does not load it, and four tests fail: TestEnvVarsInPhpIni, TestOpcachePreload_module, TestOpcachePreload_worker and TestOpcacheReset (Caddy). CI is not affected because setup-php loads OPcache.

  • TestEnvVarsInPhpIni only checks environment variable expansion in php_ini, so it now reads default_socket_timeout instead of opcache.enable.
  • The preload and opcache_reset() tests skip when OPcache is not loaded, like the hot reload test already does.

TestEnvVarsInPhpIni checks environment variable expansion in php_ini, which works the same for any directive. Reading opcache.enable made it fail on PHP < 8.5 builds where OPcache is a shared extension that isn't loaded.
PHP < 8.5 builds OPcache as a shared extension by default, so a build following the compile docs fails these tests unless a php.ini loads it. Skip them like the hot reload test already does.
@dunglas
dunglas merged commit 5e79dee into main Nov 9, 2026
45 checks passed
@dunglas
dunglas deleted the claude/fix-php83-tests-24778d branch November 9, 2026 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant