title: PHP + large CSV file + Shell
body: <p>My hosting is shared, their rule is at most <code>30</code> the <code>set_time_limit</code>, I already tried in several ways changing in <code>cpanel</code> or <code>.htaccess</code> I have many lines in different files to save.</p>
  
  <p>Currently I am cutting the contents of the files in several files so as not to exceed the time:</p>
  
  <pre><code>$lines = file(''.get_template_directory_uri() . '/lines1.csv', FILE_IGNORE_NEW_LINES);
  
  foreach ($lines as $line_num =&gt; $line){
      //here is some code for save you content line
  }
  </code></pre>
  
  <p>But, someone told me to use the code:</p>
  
  <pre><code>exec("php csv_import.php &gt; /dev/null &amp;");
  </code></pre>
  
  <p>This would run only a single file <code>.csv</code> in the background instead of multiple files , without having problems with exceeding time limit</p>
  
  <p>It is the first time I see about shell and php, and I have doubts on how to work</p>
  
  <p>I have to create a file <code>csv_import.php</code>with the normal php code? But how do I run this in the shell of my server?</p>