Skip to content

Commit 169fafa

Browse files
schlesseraclaude
andauthored
Give the Docker workers the PHP settings of the host as their php.ini (#423)
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 <noreply@anthropic.com>
1 parent 5975d9b commit 169fafa

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎utils/behat-parallel.php‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,8 @@ function wp_cli_tests_docker_mounts( $base_dir, $vendor = null ) {
501501
// Give the containers the PHP settings of the host for how errors are reported, as test
502502
// outcomes depend on them. WP-CLI, for example, only reports deprecations while testing
503503
// when error_reporting is exactly E_ALL, which a missing php.ini leads to, but not -1.
504+
// They take the place of the php.ini, as on the host, so that a process started with a
505+
// configuration file of its own, such as `php -c` by `wp server --config`, does not get them.
504506
$settings = [];
505507
foreach ( [ 'error_reporting', 'display_errors', 'display_startup_errors', 'log_errors', 'html_errors', 'zend.assertions', 'memory_limit', 'date.timezone' ] as $name ) {
506508
$value = ini_get( $name );
@@ -511,7 +513,7 @@ function wp_cli_tests_docker_mounts( $base_dir, $vendor = null ) {
511513
}
512514
$ini = "{$base_dir}/php-host.ini";
513515
file_put_contents( $ini, implode( "\n", $settings ) . "\n" );
514-
$mounts[ $ini ] = '/usr/local/etc/php/conf.d/zz-wp-cli-tests-host.ini';
516+
$mounts[ $ini ] = '/usr/local/etc/php/php.ini';
515517

516518
return $mounts;
517519
}

0 commit comments

Comments
 (0)