Rectangle 27 0

php How to deploy laravel 4.2 on shared hosting?


project/
public/
public_html/
www/
  • Copy every folder and file (except the public folder) from your laravel app into that project/ folder
  • 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.

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

I have created the folder outside de 'public_html' on my hosting and I have copied the 'public' folder from my laravel projetc inside 'public_html'. Now to access my app Do I need to specify the public folder too in the URL? I mean: lenguajemx.com/public

Yes both aspects are true, I have public_html/public and I have already copied the .htaccess inside the public_html/public folder. So I'm going to do it as you said. Thanks I'm gonna try it again.

it probably can be two things. 1) Do you have public_html/public? if so make it only public_html/{contents here} 2) Have you copied the .htaccess too?

Note
Rectangle 27 0

php How to deploy laravel 4.2 on shared hosting?


# change: 'public' => __DIR__.'/../public',
'public' => __DIR__.'/../../public_html',

I created a script to setup laravel projects for shared hosting environments. Here is the gist: https://gist.github.com/meganlkm/74dba6c4350ed58bf7bb

Note
Rectangle 27 0

php How to deploy laravel 4.2 on shared hosting?


It was pretty easy to get Laravel 4/5 running on OpenShift Online. For anyone else running into hosting issues, check out: https://hub.openshift.com/quickstarts/115-laravel-5-0

Note
Rectangle 27 0

php How to deploy laravel 4.2 on shared hosting?


/www.domain.com
/www.domain.com/public/
public/
www.domain.com
www.domain.com/public/

And from the CPANEL i link the domain name root folder to the

And then i just upload the laravel application in

I just add a new folder in the / folder on my shared hosting

It works for laravel 4.2 and 5. And there is no security breaches because the root domain folder is in the public folder of the laravel app, no need for updating the .htaccess file.

So that the path looks like this

Note