title: How to host laravel web application in Shared Hosting
body: <p>I have developed a web application using Laravel 5.8, now I want to host that to a shared web server. What will be the folder structure and exact what to configure.</p>
  
  <ol>
  <li><p>I have created a folder named laravel and kept all the project folders into that laravel folder, except project's public folder. I kept all the files and folders of public folder into public_html folder.</p></li>
  <li><p>I have configured the index.php file of public_html folder as below.</p></li>
  </ol>
  
  <p>a. <code>require __DIR__.'/../bootstrap/autoload.php';</code>
  to, </p>
  
  <pre><code>require __DIR__.'/../laravel/bootstrap/autoload.php';
  </code></pre>
  
  <p>b. <code>$app = require_once __DIR__.'/../bootstrap/app.php';</code>
  to,</p>
  
  <pre><code>$app = require_once __DIR__.'/../laravel/bootstrap/app.php';
  $app-&gt;bind('path.public', function() {
      return __DIR__;
  });
  </code></pre>
  
  <p><b>*** I have solved the problem myself.</b></p>
  
  <p>Step 1: I have found and installed laravel app into public_html folder from the cPanel</p>
  
  <p>Step 2: Then I have moved everything into a folder named <strong>laravel</strong> except <strong>public</strong> folder into a new folder outside <strong>public_html</strong> folder</p>
  
  <p>Step 3: Then I have moved everything from <strong>public</strong> folder into <strong>public_html</strong> folder</p>
  
  <p>Step 4: Later I have followed the 2nd step above</p>
  
  <p>Step 5: Then I have changed folder permission for <strong>storage</strong> folder and it works fine.</p>
  
  <p>Step 6: Finally I have kept all other files and folders of the app developed in my local server into this newly installed app directories</p>