文件由php加载,里面的配置项就是php的配置项,但这个文件可以放到每个网站的根目录,这样就可以每个网站有自己单独的配置文件,且这个配置文件默认只有5分钟的缓存期,5分钟后会重新加载

比如,如果我们有很多站点,但其中有个站点要禁用opcache,那么就可以在.user.ini文件中加上对应的配置

opcache.enable=0
opcache.enable_cli=0

 

.user.ini文件的相关配置,可查看php.ini文件的一下章节

;;;;;;;;;;;;;;;;;;;;
; php.ini Options  ;
;;;;;;;;;;;;;;;;;;;;
; Name for user-defined php.ini (.htaccess) files. Default is ".user.ini"
;user_ini.filename = ".user.ini"

; To disable this feature set this option to empty value
;user_ini.filename =

; TTL for user-defined php.ini files (time-to-live) in seconds. Default is 300 seconds (5 minutes)
;user_ini.cache_ttl = 300

posted on 2021-05-18 10:55  lbnnbs  阅读(503)  评论(0编辑  收藏  举报