Docs / Performance Optimization / How to Enable and Configure PHP JIT Compiler

How to Enable and Configure PHP JIT Compiler

By Admin · Mar 1, 2026 · Updated Apr 24, 2026 · 25 views · 2 min read

What Is the PHP JIT Compiler?

The Just-In-Time (JIT) compiler was introduced in PHP 8.0 as part of OPcache. It compiles PHP bytecode into native machine code at runtime, delivering significant performance gains for CPU-intensive workloads such as mathematical computations, image processing, and data transformations.

Prerequisites

  • A Breeze running Ubuntu 22.04 or later with PHP 8.0+
  • OPcache extension enabled
  • Root or sudo access

Step 1: Verify OPcache Is Enabled

php -m | grep -i opcache

If OPcache is not listed, install it:

sudo apt install php-opcache

Step 2: Configure JIT in php.ini

Open your PHP configuration file:

sudo nano /etc/php/8.3/fpm/conf.d/10-opcache.ini

Add or update the following directives:

opcache.enable=1
opcache.jit_buffer_size=128M
opcache.jit=1255

Understanding JIT Modes

  • 1255 — Tracing JIT with optimizations (recommended for most workloads)
  • 1205 — Tracing JIT without register allocation (lower memory)
  • disable — Turns JIT off entirely

Step 3: Restart PHP-FPM

sudo systemctl restart php8.3-fpm

Step 4: Verify JIT Is Active

Create a quick info page or use the CLI:

php -r "var_dump(opcache_get_status()['jit']);"

You should see enabled => true and the buffer size you configured.

Performance Tips

  • JIT benefits CPU-bound tasks most; typical web applications may see modest gains
  • Monitor memory usage — increase jit_buffer_size if the buffer fills up
  • Combine JIT with OPcache preloading for maximum throughput on your Breeze

Was this article helpful?