.user.ini or similar for php-fpm

castris

Verified User
Joined
Apr 16, 2021
Messages
150
Location
Arcenillas
Hi,

Some plugins like Wordfence need to create or add a mechanism to inject certain values into PHP configuration. For example:

PHP:
; Wordfence WAF
auto_prepend_file = '/home/user/domains/domain.tld/public_html/wordfence-waf.php'
; END Wordfence WAF

zend_extension=opcache.so
opcache.jit=off

What's the best way to handle this?
 
Isn't put into '.user.ini' on public_html does work ?
Yes this works. I have a WP Install on one server and WHMCS in another folder. In the WHMCS folder I disable opcache in a .user.ini file so it works on WP, but doesn't interfere with WHMCS.

.user.ini (as in this case) can also enable or disable elements on a folder level, rather than setting site globals.

If i want PHP settings set or unset on the whole site (account) I would simply use the Custom HTTPD Configurations bit in the Admin panel, and put the values I needed into the pertaining php-fpmXX.conf in the |CUSTOM1| or |CUSTOM2| bit. Again, I use this for setting up php session.save to REDIS rather than file.
 
Last edited:
I think yes, but on phpinfo(), opcache.jit is not a key, and server show values for opeache.jit enabled

Best regards
 

Attachments

  • CleanShot 2025-10-23 at 09.43.29.jpg
    CleanShot 2025-10-23 at 09.43.29.jpg
    160.3 KB · Views: 5
To turn it off, you're only interested in the following directives:
opcache.jit
opcache.jit_buffer_size

Depending on your php version, opcache.jit should be 'disable' to turn it off, it may show "tracing" after in phpinfo() but that's the default value I believe. It shows as tracing on mine (I'm using 8.3xx and jit is off):

1761209395353.png


Set opcache.jit_buffer_size = 0 and that should turn it off. You'll still see all the other bits again on phpinfo() but it should be off.

Hope this is of some use?

Refer to the PHP maunual here for this: https://www.php.net/manual/en/opcache.configuration.php

1761209044942.png
 
if you are enabled ioncube opcache.jit will not work
you will get warning

incompatible with extensions that override zend_execute_ex(), such as xdebug

and opcache.jit = disabled

ioncube enabled

jit1.png



Ioncube disabled

jit2.png
 
Back
Top