From d2fcb3ac55b830c1c34b862c86d0720d5252f5d6 Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Mon, 2 Nov 2026 16:08:56 +0000 Subject: [PATCH] Give the Docker workers the PHP settings of the host as their php.ini As a file in conf.d, the settings were also loaded by processes that pass a configuration file of their own, which on the host replaces them. With memory_limit = -1 on the GitHub runners, the custom ini scenario of server-command (wp server --config) got -1 instead of its own 512M. Co-Authored-By: Claude Opus 5.5 --- utils/behat-parallel.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/behat-parallel.php b/utils/behat-parallel.php index a3be0547..eb2fa976 100644 --- a/utils/behat-parallel.php +++ b/utils/behat-parallel.php @@ -501,6 +501,8 @@ function wp_cli_tests_docker_mounts( $base_dir, $vendor = null ) { // Give the containers the PHP settings of the host for how errors are reported, as test // outcomes depend on them. WP-CLI, for example, only reports deprecations while testing // when error_reporting is exactly E_ALL, which a missing php.ini leads to, but not -1. + // They take the place of the php.ini, as on the host, so that a process started with a + // configuration file of its own, such as `php -c` by `wp server --config`, does not get them. $settings = []; foreach ( [ 'error_reporting', 'display_errors', 'display_startup_errors', 'log_errors', 'html_errors', 'zend.assertions', 'memory_limit', 'date.timezone' ] as $name ) { $value = ini_get( $name ); @@ -511,7 +513,7 @@ function wp_cli_tests_docker_mounts( $base_dir, $vendor = null ) { } $ini = "{$base_dir}/php-host.ini"; file_put_contents( $ini, implode( "\n", $settings ) . "\n" ); - $mounts[ $ini ] = '/usr/local/etc/php/conf.d/zz-wp-cli-tests-host.ini'; + $mounts[ $ini ] = '/usr/local/etc/php/php.ini'; return $mounts; }