1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

phpのバージョンを7.3まで上げたらLOAD DATA LOCAL INFILE forbiddenになった

Last updated at Posted at 2020-01-31

事象

DBUnitでfixtureファイル読み込みをしている箇所で、
PHPのバージョンを7.3.13まで上げたところ以下のエラーになりました。

Fuel\Core\PhpErrorException: mysqli::query(): LOAD DATA LOCAL INFILE forbidden

fixtureが読み込めていないよう・・・

解決

どうやらphpのバージョンを上げたことにより
MySQLi 設定オプションのデフォルト値が変わったよう。

php.initに以下の設定をすると解決しました。

mysqli.allow_local_infile = On

スクリーンショット 2020-01-31 11.23.07.png

PHP 7.2.16, 7.3.3 より前のバージョンでは デフォルト値は "1" でした。

mysqli.allow_local_infile
PHP 側から、LOAD DATA 文によるローカルファイルへのアクセスを許可する。

とのことなので今回php7.3.13まで上げたのでビンゴのようです。

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?