title: PHP : LOAD DATA LOCAL INFILE forbidden
body: <p>I got a problem when executing a LOAD DATA LOCAL INFILE via php.</p>
  
  <p><code>PDOStatement::execute(): LOAD DATA LOCAL INFILE forbidden in /blablabla</code></p>
  
  <p>Query is working with mysql directly, but it do no work with php.</p>
  
  <p>I checked my local_infile from mysql, it is ok :</p>
  
  <p><code>SHOW GLOBAL VARIABLES LIKE 'local_infile';
  +---------------+-------+
  | Variable_name | Value |
  +---------------+-------+ 
  | local_infile  | ON    |
  +---------------+-------+
  1 row in set (0.00 sec)</code></p>
  
  <p>There are some others questions about that but I can't modify source code (so PDO configuration in php code) :
  <a href="https://stackoverflow.com/questions/7638090/load-data-local-infile-forbidden-in-php">LOAD DATA LOCAL INFILE forbidden in... PHP</a></p>
  
  <p><strong>EDIT :</strong> I find how to configure pdo in my case, and I added PDO::MYSQL_ATTR_LOCAL_INFILE => true option in PDO.</p>
  
  <p>I got an other error :</p>
  
  <p><code>[13:10:16] SQLSTATE[42000]: Syntax error or access violation: 1148 The used command is not allowed with this MySQL version, query was: LOAD DATA LOCAL INFILE '/tmp/export_cat_28.csv' REPLACE INTO TABLE tmp_pimgento_entities_category FIELDS TERMINATED BY ';' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' IGNORE 1 LINES;
  </code></p>
  
  <p>Query still work with mysql directly.</p>
  
  <p>Any ideas ?
  Thanks.</p>