title: Export excel file using PHPExcel working in my local pc but not working in live server
body: <p>I have a "Download excel file" button in my website. When I click this button, it runs <code>download_header()</code> function.  Here is the function's code</p>
  
  <pre><code>public function download_header($pid)
  {
      // get pick_list table's field name
      $this-&gt;load-&gt;model('Download_excel_model');
      $fields = $this-&gt;Download_excel_model-&gt;table_field_name('pick_list');
  
      // Starting the PHPExcel library
      $this-&gt;load-&gt;library('excel');
      $objPHPExcel = new PHPExcel();
      $objPHPExcel-&gt;getProperties()-&gt;setTitle("export")-&gt;setDescription("none");
      $objPHPExcel-&gt;setActiveSheetIndex(0);
      // Field names in the first row
      $col = 0;
      foreach ($fields as $field)
      {
          if($field != 'id' &amp;&amp; $field != 'status' &amp;&amp; $field != 'created_date' &amp;&amp; $field != 'updated_date' &amp;&amp; $field != 'extra' &amp;&amp; $field != 'user_id' &amp;&amp; $field != 'pid' &amp;&amp; $field != 'qty_scaned')
          {
              $objPHPExcel-&gt;getActiveSheet()-&gt;setCellValueByColumnAndRow($col, 1, $field);
              $col++;
          }
      }
  
      $objPHPExcel-&gt;setActiveSheetIndex(0);
      $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
      // Sending headers to force the user to download the file
      header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
      header('Content-Disposition: attachment;filename="Sample_'.date('dMy').'.xlsx"');
      header('Cache-Control: max-age=0');
      $objWriter-&gt;save('php://output');
  }
  </code></pre>
  
  <p>And here is the <code>table_field_name()</code> function's code</p>
  
  <pre><code>public function table_field_name($table)
  {
      $query = $this-&gt;db-&gt;list_fields($table);
      return $query;
  }
  </code></pre>
  
  <p>It's working fine in my localhost and I can download excel file but not working it in live server. it shows this error</p>
  
  <blockquote>
    <p>This site can’t be reached
    The webpage at <a href="http://dataraceltd.com/demo/bin/download_excel_file/download_header/18" rel="nofollow">http://dataraceltd.com/demo/bin/download_excel_file/download_header/18</a> might be temporarily down or it may have moved permanently to a new web address.
    ERR_INVALID_RESPONSE</p>
  </blockquote>
  
  <p>Plz Help</p>