title: LOAD DATA LOCAL INFILE forbidden in... PHP
body: <p>I am trying to use <code>LOAD DATA INFILE</code> to insert some records into a table. Unfortunately, it's not working.</p>
  
  <p>Here are some details</p>
  
  <p>If I use this instruction:</p>
  
  <pre><code>LOAD DATA INFILE 'file.txt'
  INTO TABLE table_ex
  FIELDS TERMINATED BY ','
  LINES TERMINATED BY '\n'
  (field1, field2, field3, field4);
  </code></pre>
  
  <p>It works using the MySQL client program and a PHP application. In this way it will look for the file in the Data Directory of my MySQL installation.</p>
  
  <p>Now if I try to execute the instructions using the <code>LOCAL</code> option, it only works if I use the mysql client, but not from PHP:</p>
  
  <pre><code>LOAD DATA LOCAL INFILE 'path/to/file/file.txt'
  INTO TABLE table_ex
  FIELDS TERMINATED BY ','
  LINES TERMINATED BY '\n'
  (field1, field2, field3, field4);
  </code></pre>
  
  <p>Again.. it works with MySQL client but not from the PHP application... I get this error:</p>
  
  <pre><code>LOAD DATA LOCAL INFILE forbidden in /path/to/my/application
  </code></pre>
  
  <p>I read that the problem is related to the compilation of PHP and using mysqlnd. I am using PHP 5.3.8 and MySQL 5.5.15, but I haven't found a solution.</p>
  
  <p>Additional information: until now the only help I've found was an <a href="http://bugs.php.net/bug.php?id=55737" rel="noreferrer">open PHP bug</a>:</p>