How to deploy laravel 4.2 on shared hosting?

后端 未结 5 1439
遇见更好的自我
遇见更好的自我 2020-12-09 06:00

I developed an application with laravel 4.2.8 and now I am having trouble deploying it. I followed this answer https://stackoverflow.com/a/16683938/3153380 but its not worki

5条回答
  •  醉酒成梦
    2020-12-09 06:58

    First make sure that your shared host runs php >= v5.4. Second try to follow this steps:

    1. Create a folder outside your public_html/ or www/. Ex: project/
    2. Copy every folder and file (except the public folder) from your laravel app into that project/ folder
    3. Copy the content of public/ folder into your public_html/ or www/ (the .htaccess must be there too)
    4. Inside public/ locate the index.php file and change the following paths:

      a. Path to autoload.php

      require __DIR__.'/../bootstrap/autoload.php';
      

      into

      require __DIR__.'/../project/bootstrap/autoload.php';
      

      b. Path to start.php

      $app = require_once __DIR__.'/../bootstrap/start.php';
      

      into

      $app = require_once __DIR__.'/../project/bootstrap/start.php';`
      

    After all that it should be working.

提交回复
热议问题