Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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 working. I am getting a white screen and the headers are returning a 500 Internal Server Error status.

I read around that laravel 4.2 is a bit tricky to set up on shared hosting is this true? I can seem to find a working solution so those that have deployed 4.2 before please help. My folder structure is like below

root/ laravel_base/ app/ ... public_html/ siteroot/ assets/ packages/ uploads/ index.php ... Any pointers?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
287 views
Welcome To Ask or Share your Answers For Others

1 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...