title: Run .sh file using exec Laravel PHP
body: <p>I am trying to run a .sh file that will import a excel file to my database. Both files are in same directory inside the public folder. For some reason the exec command isn't being executed or neither any error occurs.</p>
  
  <p>.sh file colde:</p>
  
  <pre><code>IFS=,
  while read column1  
        do
          echo "SQL COMMAND GOES HERE"
  
  done &lt; file.csv | mysql --user='myusername' --password='mypassword' -D databasename;
  echo "finish"
  </code></pre>
  
  <p>In my php file i have tried following:</p>
  
  <pre><code>$content = file_get_contents('folder_name/file_name.sh');
  echo exec($content);
  </code></pre>
  
  <p>And:</p>
  
  <pre><code>shell_exec('sh /folder_name/file_name.sh');
  </code></pre>
  
  <p>Note: I can directly execute the sh file from gitbash however I want it to be done using function in Laravel controller. I'm using windows OS.</p>