|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-02-03 20:13 UTC] phpbugs2012 at joern dot heissler dot de
[2015-11-16 09:02 UTC] laruence@php.net
[2015-11-16 09:02 UTC] laruence@php.net
-Status: Open
+Status: Closed
[2015-11-16 10:00 UTC] laruence@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 01:00:01 2025 UTC |
Description: ------------ When open_basedir is set (to whatever, / for exemple), we've can't send a "LOAD DATA LOCAL INFILE" sql command and got this error : SQLSTATE[42000]: Syntax error or access violation: 1148 The used command is not allowed with this MySQL version If the open_basedir directive is not set, the command works fine. If we can't use open_basedir directive with this sql command (for security reasons), please update documentation. Test script: --------------- try { $pdo = new \PDO('mysql:host=127.0.0.1;dbname=test','test','test', array( \PDO::MYSQL_ATTR_LOCAL_INFILE => true, \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION )); $pdo->query("LOAD DATA LOCAL INFILE '/tmp/test.csv' INTO TABLE test_table"); } catch(Exception $e) { echo $e->getMessage()."\n"; } Actual result: -------------- SQLSTATE[42000]: Syntax error or access violation: 1148 The used command is not allowed with this MySQL version