Enable the PHP JIT compiler
ServerPilot currently does not enable the JIT in PHP 8.0. This is because the design of the JIT as well as current benchmarks show that it may hurt web application performance rather than improve it.
Unless you’re dealing with a long-running CPU-intensive PHP program that is not a web application, enabling the JIT for performance improvements will probably not be a good use of your time.
To enable the PHP JIT compiler,
SSH into your server as root
and edit the following file.
/etc/php8.4-sp/conf.d/opcache.ini
/etc/php8.3-sp/conf.d/opcache.ini
/etc/php8.2-sp/conf.d/opcache.ini
/etc/php8.1-sp/conf.d/opcache.ini
/etc/php8.0-sp/conf.d/opcache.ini
Add the following line to the end of the file.
opcache.jit_buffer_size=100M
Finally, restart PHP.
sudo service php8.4-fpm-sp restart
sudo service php8.3-fpm-sp restart
sudo service php8.2-fpm-sp restart
sudo service php8.1-fpm-sp restart
sudo service php8.0-fpm-sp restart
To verify the JIT was enabled, create a page that calls the phpinfo()
function,
request the page from your browser,
and verify opcache.jit_buffer_size
shows the value of 100M
rather than 0
.