Fix jit config on arm

This commit is contained in:
Shivam Mathur
2025-09-11 18:38:04 +05:30
parent 6ffdb3d118
commit dcffe28928
3 changed files with 7 additions and 2 deletions

View File

@ -742,7 +742,7 @@ act -P ubuntu-22.04=shivammathur/node:2204
- To enable JIT, enable `opcache` in cli mode by setting `opcache.enable_cli=1`.
- JIT conflicts with `Xdebug`, `PCOV`, and other extensions which override `zend_execute_ex` function, so set `coverage: none` and disable any such extension if added.
- By default, `opcache.jit=1235` and `opcache.jit_buffer_size=256M` are set which can be changed using `ini-values` input.
- By default, `opcache.jit=1235` and `opcache.jit_buffer_size=256M` (`opcache.jit_buffer_size=128M` on ARM-based environments) are set which can be changed using `ini-values` input.
- For detailed information about JIT related directives refer to the [`official PHP documentation`](https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.jit "opcache.jit documentation").
For example to enable JIT in `tracing` mode with buffer size of `64 MB`.

View File

@ -0,0 +1,3 @@
opcache.enable=1
opcache.jit_buffer_size=128M
opcache.jit=1235

View File

@ -244,7 +244,9 @@ configure_php() {
add_php_config
ini_config_dir="${src:?}"/configs/ini
ini_config_files=("$ini_config_dir"/php.ini)
jit_config_files=("$ini_config_dir"/jit.ini)
arch="$(uname -m)"
[[ "$arch" = "arm64" || "$arch" = "aarch64" ]] && jit_ini="$ini_config_dir"/jit_aarch64.ini || jit_ini="$ini_config_dir"/jit.ini
jit_config_files=("$jit_ini")
[[ "$version" =~ $xdebug3_versions ]] && ini_config_files+=("$ini_config_dir"/xdebug.ini)
cat "${ini_config_files[@]}" | sudo tee -a "${ini_file[@]:?}" >/dev/null 2>&1
[[ "$version" =~ $jit_versions ]] && cat "${jit_config_files[@]}" | sudo tee -a "${pecl_file:-${ini_file[@]}}" >/dev/null 2>&1