title: Unable to locate Mix file when deploying laravel to shared hosting
body: <p>We tried deploying our laravel server by uploading our laravel folder to the linux server. We put the public folder in the public_html/laravelsite and the everything else in the a folder called laravelsite. We added </p>
  
  <pre><code>   $this-&gt;app-&gt;bind('path.public', function() {
          return base_path().'/../public_html';
      });
  </code></pre>
  
  <p>to our AppServiceProvider. But when viewing the site in the browser we get the following errors.</p>
  
  <blockquote>
    <p>app.css:1 Failed to load resource: the server responded with a status
    of 500 (Internal Server Error) bootstrap.js:1</p>
    
    <p>Failed to load resource:
    the server responded with a status of 500 (Internal Server Error)
    app.js:1 </p>
    
    <p>Failed to load resource: the server responded with a status of 500
    (Internal Server Error) bootstrap.js:1</p>
    
    <p>Failed to load resource: the server responded with a status of 500
    (Internal Server Error) app.js:1</p>
    
    <p>Failed to load resource: the server responded with a status of 500
    (Internal Server Error) app.css:1</p>
    
    <p>app.css:1 Failed to load resource: the server responded with a status
    of 500 (Internal Server Error) app.css:1</p>
  </blockquote>
  
  <p>I commented the code that produces the errors in the landing.blade So we looked at the following post</p>
  
  <p><a href="https://stackoverflow.com/questions/42051576/how-can-i-change-the-public-path-to-something-containing-an-underscore-in-larave">How can I change the public path to something containing an underscore in Laravel Mix?</a></p>
  
  <p>But doing that did not work out for us. </p>
  
  <p><strong>landing.blade(landing page)</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;!-- hidden override for w3 style this has to be removed before this goes in production !!!!!!!! --&gt;
  &lt;html style="overflow:hidden"&gt;
  
  &lt;head&gt;
      &lt;meta property="og:image" content="/favicon.png" /&gt;
      &lt;title&gt;Laravel Site&lt;/title&gt;
      &lt;meta name="description" content="Welcome to out Laravel Site. Come on in!" /&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
      &lt;meta name="csrf-token" content="{{csrf_token()}}"&gt;
      &lt;!-- This is the first error --&gt;
      &lt;link href=" {{ mix('css/app.css') }}" rel="stylesheet"&gt;
      &lt;link href='https://fonts.googleapis.com/css?family=Raleway:800' rel='stylesheet'&gt;
      &lt;link href='https://fonts.googleapis.com/css?family=Raleway:500' rel='stylesheet' type='text/css'&gt;
      &lt;link href=" {{ asset('css/animate.css') }}" rel="stylesheet"&gt;
      &lt;link href=" {{ asset('css/text-editor.css') }}" rel="stylesheet"&gt;
      &lt;link href='https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900|Material+Icons' rel="stylesheet"&gt;
      &lt;script src="https://d3-geomap.github.io/d3-geomap/vendor/d3.geomap.dependencies.min.js"&gt;&lt;/script&gt;
      &lt;script src="https://d3-geomap.github.io/d3-geomap/js/d3.geomap.min.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body style="background-color: #f2f2f2;"&gt;
      &lt;div id="app"&gt;
          &lt;app&gt;&lt;/app&gt;
      &lt;/div&gt;
          &lt;!-- This is the second error --&gt;
      &lt;script src="{{ mix('js/bootstrap.js') }}"&gt;&lt;/script&gt;
          &lt;!-- This is the third error --&gt;
      &lt;script src="{{ mix('js/app.js') }}"&gt;&lt;/script&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>webpack.mix</strong></p>
  
  <pre><code>let mix = require("laravel-mix");
  
  mix.setPublicPath("public_html/laravelsite/");
  /*
   |--------------------------------------------------------------------------
   | Mix Asset Management
   |--------------------------------------------------------------------------
   |
   | Mix provides a clean, fluent API for defining some Webpack build steps
   | for your Laravel application. By default, we are compiling the Sass
   | file for the application as well as bundling up all the JS files.
   |
   */
  mix.webpackConfig({
    resolve: {
      extensions: [".js", ".vue", ".json"],
      alias: {
        vue$: "vue/dist/vue.esm.js",
        "@": __dirname + "/resources/assets/js"
      }
    }
  });
  
  mix
    .js("resources/assets/js/app.js", "public_html/laravelsite/js")
    .setResourceRoot("")
    .js("resources/assets/js/bootstrap.js", "public_html/laravelsite/js")
    .sass("resources/assets/sass/app.scss", "public_html/laravelsite/css");
  </code></pre>
  
  <p>It is trying to load the files at <a href="http://websitename.com/css/app.css" rel="nofollow noreferrer">http://websitename.com/css/app.css</a> , so it's probably looking in the public_html folder. But inside that folder we have another folder called laravelsite so it should be looking for <a href="http://websitename.com/laravelsite/css/app.css" rel="nofollow noreferrer">http://websitename.com/laravelsite/css/app.css</a></p>