LOAD DATA LOCAL INFILE forbidden in… PHP

后端 未结 12 1116
无人共我
无人共我 2020-12-01 10:38

I am trying to use LOAD DATA INFILE to insert some records into a table. Unfortunately, it\'s not working.

Here are some details

If I use this i

12条回答
  •  温柔的废话
    2020-12-01 11:12

    2019+ relevant answer with a bit more background:

    In PHP >7.2.16 and >7.3.3 the default ini configuration of mysqli.allow_local_infile, which controls this, changed from '1' to '0' (so it is now disabled by default).

    This directive is only configurable via PHP_INI_SYSTEM so ini_set() will not work.

    The only option is to add the following directive to your php.ini file, not forgetting to reload apache.

    [MySQLi]
    mysqli.allow_local_infile = On
    

提交回复
热议问题