title: Laravel 5 Server Error 500 Hosting in cpanel
body: <p>I have already uploaded my laravel project folder into cpanel hosting. I have followed many examples here but still getting the famous 500 internal error. This is what I have done:</p>
  
  <p>I has separated public folder in my laravel project and put in my public_html folder. I have made the rest of my laravel project into myapp folder.</p>
  
  <p>Into my public_html folder, I have changed this lines:</p>
  
  <pre><code>require __DIR__.'/../myapp/vendor/autoload.php';
  
  /*
  |--------------------------------------------------------------------------
  | Turn On The Lights
  |--------------------------------------------------------------------------
  |
  | We need to illuminate PHP development, so let us turn on the lights.
  | This bootstraps the framework and gets it ready for use, then it
  | will load up this application so that we can run it and send
  | the responses back to the browser and delight our users.
  |
  */
  
  $app = require_once __DIR__.'/../myapp/bootstrap/app.php';
  </code></pre>
  
  <p>This is my .env file:</p>
  
  <pre><code>APP_NAME=Driveostle
  APP_ENV=local
  APP_KEY=base64:xxx
  APP_DEBUG=true
  APP_LOG_LEVEL=debug
  APP_URL=http://www.driveostle.ma
  </code></pre>
  
  <p>This is my .htaccess file:</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
      &lt;IfModule mod_negotiation.c&gt;
          Options -MultiViews
      &lt;/IfModule&gt;
  
      RewriteEngine On
  
      # Redirect Trailing Slashes If Not A Folder...
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_URI} (.+)/$
      RewriteRule ^ %1 [L,R=301]
  
      # Handle Front Controller...
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule ^ index.php [L]
  
      # Handle Authorization Header
      RewriteCond %{HTTP:Authorization} .
      RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  &lt;/IfModule&gt;
  
  </code></pre>
  
  <p>This is my server.php file:</p>
  
  <pre><code>&lt;?php
  
  /**
   * Laravel - A PHP Framework For Web Artisans
   *
   * @package  Laravel
   * @author   Taylor Otwell &lt;taylor@laravel.com&gt;
   */
  
  $uri = urldecode(
      parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
  );
  
  // This file allows us to emulate Apache's "mod_rewrite" functionality from the
  // built-in PHP web server. This provides a convenient way to test a Laravel
  // application without having installed a "real" web server software here.
  if ($uri !== '/' &amp;&amp; file_exists(__DIR__.'/public'.$uri)) {
      return false;
  }
  
  require_once __DIR__.'/public/index.php';
  </code></pre>
  
  <p>I still got the HTTP ERROR 500 after typing my domaine name.</p>
  
  <p>After searching here, I have found someone that asked for editing the .htaccess by adding this code:</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
     RewriteEngine On 
     RewriteRule ^(.*)$ public/$1 [L]
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>The error that I obtained was different:</p>
  
  <pre><code>Internal Server Error
  The server encountered an internal error or misconfiguration and was unable to complete your request.
  
  Please contact the server administrator at webmaster@driveostle.ma to inform them of the time this error occurred, and the actions you performed just before this error.
  
  More information about this error may be available in the server error log.
  
  Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
  </code></pre>
  
  <p>Also, my PHP Selector version in Cpanel, I have choose the 7.1 version.</p>
  
  <p>And in my composer.json file:</p>
  
  <pre><code>{
      "name": "laravel/laravel",
      "description": "The Laravel Framework.",
      "keywords": ["framework", "laravel"],
      "license": "MIT",
      "type": "project",
      "require": {
          "php": "&gt;=7.0.0",
          "fideloper/proxy": "~3.3",
          "intervention/image": "^2.4",
          "laravel/framework": "5.5.*",
          "laravel/tinker": "~1.0",
          "mews/purifier": "^2.0"
      },
  ...
  </code></pre>
  
  <p>I don't know what is missed in my configuration, It is my first time hosting a laravel website, I hope the elements that I have posted will give you an idea of what I have missed.</p>
  
  <p>If you need any file content, I will post it with pleasure.</p>
  
  <p>Thank you</p>