title: Linux hosting file upload
body: <p>I'm using Godaddy linux hosting and have a problem with uploading image on my website. Max file size that I want to allow for upload is 1mb and allow extensions jpg, jpeg, png and gif. I limit that with my PHP code. I can upload image smaller than 1mb and in that case it works fine. Image is uplaoded and data is stored in database. Also, when I try to upload image smaller than 2mb but bigger than 1mb my PHP code works ok and my code stop uploading file and display my warning that max allowed  file size is 1mb. Also, everything work fine when I try to upload other file type that not allowed if it is smaller than 2mb code display warning that file size and file type not allowed. Problem is when I try to upload file bigger than 2mb. Than my code doesn't work. There is no displaying my warning that max allowed file size is 1mb. Database was updated but shouldn't be and header redirect me to success url. My code works fine on local server, but doesn't work on godaddy server when file is bigger than 2mb.</p>
  
  <pre><code>&lt;?php
  
      if (isset($_FILES['image'], $_POST['news_id'])) {
      $image_name = $_FILES['image']['name'];
      $image_size = $_FILES['image']['size'];
      $image_temp = $_FILES['image']['tmp_name'];
  
      $allowed_ext = array('jpeg', 'jpg', 'png', 'gif');
      $image_ext = strtolower(end(explode('.', $image_name)));
  
      $news_id = $_POST['news_id'];
      $errors = array();
  
      if (empty($image_name) || empty($news_id)) {
          $errors[] = 'Oooop\'s! Something went wrong!';
      } else {
  
          if (in_array($image_ext, $allowed_ext) === false) {
              $errors[] = 'Allowed file type is "jpg, jpeg, png i gif"!';
          }
  
          if ($image_size &gt; 1048576 ) {
              $errors[] = 'Max allowed file size is 1mb!';
          }
  
      }
  
      if (!empty($errors)) {
          foreach ($errors as $error) {
              echo output_errors($errors);
          }
      } else {
          $this-&gt;model-&gt;uploadImage($image_temp, $image_ext, $news_id);
          header('Location: ' . URL . 'admin_panel/add_images/success');
          exit();
      }
  }
  ?&gt;
  </code></pre>