title: Codeigniter do_upload doesn't response in production server
body: <p>I made a page that will upload certain file types.
  It works fine in my local development but not in production.
  It won't pass the do_upload() function. Nothing is displayed beyond that.</p>
  
  <pre><code>$path = 'uploads';
  echo 'path: '. $path .' &lt;br&gt;'; 
  
  //-- config for uplaod --
  $configUpdload['upload_path']   = $path ;
  $configUpdload['allowed_types'] = 'gif|jpg|png|xls|xlsx|pdf';
  $configUpdload['max_size']   = '4000'; //size in kilobytes
  $configUpdload['encrypt_name']  = TRUE;
  
  //-- load upload library --
  $this-&gt;load-&gt;library('upload');
  
  $this-&gt;upload-&gt;initialize($configUpdload);
  
  if ($_FILES['fileref']['name']!="")
  {
      ini_set('display_errors', true);
      error_reporting(E_ALL);
  
      echo 'uploadAttachment&lt;br&gt;';
  
      $uploaded = $this-&gt;upload-&gt;do_upload("fileref");
  
      echo 'uploaded: '. $uploaded . '&lt;br&gt;';
  
      if ($uploaded == true)
      {
          echo 'uploaded data&lt;br&gt;';
          $inputUp = $this-&gt;upload-&gt;data();
          echo 'data: '. print_r($inputUp,true) . '&lt;br&gt;'; 
          $uploadInput['orig_name']   = $inputUp['orig_name'];
          $uploadInput['enc_name']    = $inputUp['file_name'];
          $uploadInput['extension']   = $inputUp['file_ext'];
  
          echo 'uploaded true&lt;br&gt;';
      }else{
          die($this-&gt;upload-&gt;display_errors());
      }
  }
  </code></pre>
  
  <p>I tried changing the upload_path to non existing folder, it show 'The upload path does not appear to be valid'. Means the do_upload() does work right?</p>
  
  <p>The uploads folder permission is 777.</p>
  
  <p>I also tried using absolute path but still doesnt show anything pass do_upload().</p>
  
  <p>Or anything to do with the server?</p>
  
  <p>Does anyone knows what is happening? Help much appreciated.</p>
  
  <p>Thanks.</p>
  
  <p>[edit1]</p>
  
  <p>Nothing in the server's error log nor normal log. I also set $config['log_threshold'] = 4; No error log.</p>
  
  <p>[edit2]</p>
  
  <p>Production server is 3rd party web hosting under linux. I tried php_info() and trace anything to do with upload.    </p>
  
  <pre><code>file_uploads        On  On  
  max_file_uploads    20  20  
  pload_max_filesize  30M 30M  
  upload_tmp_dir      /tmp/   /tmp/  
  suhosin.upload.disallow_binary  0   0  
  suhosin.upload.disallow_elf 1   1  
  suhosin.upload.max_uploads  25  25  
  suhosin.upload.remove_binary    0   0  
  suhosin.upload.verification_script  no value  
  </code></pre>
  
  <p>  
  I also tried decrease the filesize $configUpdload['max_size']   = '10'; but no message after do_upload() still.</p>
  
  <p>[Edit3]
  My folder structure:</p>
  
  <pre><code>public_html/gtapp/
  public_html/gtapp/csystem/ &lt;- is system folder
  public_html/gtapp/v1/ &lt;- is application folder
  public_html/gtapp/media/
  public_html/gtapp/uploads/
  public_html/gtapp/license.txt
  </code></pre>
  
  <p>In config.php:</p>
  
  <pre><code>$config['base_url'] = 'http://www.example.com/gtapp/
  </code></pre>
  
  <p>In index.php:</p>
  
  <pre><code>$application_folder = 'v1';
  </code></pre>
  
  <p>when I do <code>APPPATH . 'uploads';</code> to above code is shows: </p>
  
  <pre><code>uploadAttachment
  path: v1/uploads
  uploaded: 
  The upload path does not appear to be valid.
  </code></pre>
  
  <p>I tried <code>$path = $_SERVER['DOCUMENT_ROOT'] . '/gtapp/uploads';</code> 
  It just shows:</p>
  
  <pre><code>uploadAttachment
  path: /home/user/domains/example.com/public_html/gtapp/uploads 
  </code></pre>
  
  <p>[Edit4]</p>
  
  <p>I made a crude version of native PHP upload codes and it works. I dont think it is a server issue. Below is the code:</p>
  
  <pre><code>$name = 'fileref'; 
  
  $upload_path    = './uploads/';
  $allowed_types  = array("jpg", "jpeg", "gif", "png", "xls", "xlsx", "pdf");
  $extension      = end(explode(".", $_FILES[$name]["name"]));
  $max_size       = '4000';
  
  if ($_FILES['fileref']['name']!="")
  {
      if ((($_FILES[$name]["type"] == "image/gif")
          || ($_FILES[$name]["type"] == "image/jpeg")
          || ($_FILES[$name]["type"] == "image/pjpeg")
          || ($_FILES[$name]["type"] == "image/png")
          || ($_FILES[$name]["type"] == "image/x-png")
          || ($_FILES[$name]["type"] == "application/excel")
          || ($_FILES[$name]["type"] == "application/vnd.ms-excel")
          || ($_FILES[$name]["type"] == "application/msexcel")
          || ($_FILES[$name]["type"] == "application/pdf")
          || ($_FILES[$name]["type"] == "application/x-download"))
          &amp;&amp; (round($_FILES[$name]["size"]/1024,2) &lt; $max_size )
          &amp;&amp; in_array($extension, $allowed_types))
          {
  
              if ($_FILES[$name]["error"] &gt; 0)
              {
                  echo $_FILES[$name]["error"]);
              }
              else
              {
                  $uploadInput['orig_name']   = $_FILES[$name]["name"];
                  $uploadInput['enc_name']    = sha1($_FILES[$name]["name"]);
                  $uploadInput['extension']   = $_FILES[$name]["type"];
  
                  $moved = move_uploaded_file($_FILES[$name]["tmp_name"], $upload_path . $uploadInput['enc_name'] . '.' . $extension);
  
                  if($moved)
                      echo 'success';
                  else
                      echo 'fail';
  
              }
          }
  }
  </code></pre>