I found this not working and it confused me for a while, until I found out that PHP had disabled mysqli.allow_local_infile by default as of PHP 7.2.16 / 7.3.3.
It’s particularly confusing because the production default config, which I believe Debian installs, makes it look like On is still the default - it isn’t. You have to remove the semicolon before the line provided, as so:
mysqli.allow_local_infile = On