0

I have made a project using laravel but have no experience in uploading it to production. I am using a shared hosting site DirectAdmin. Here are the steps I have taken so far.

I have changed my .env to reflect the database details.

  1. I have uploaded the laravel project to the server

2.a. I have uploaded the contents of laravel to be adjacent to public_html

2.b. I have uploaded the contents of public to the public_html folder.

  1. I have changed the paths in index.php to

    /../laravel/bootstrap/

as user SID has posted a few times I have also done the following

I created the following in my bootstrap/app.php

// $app = new Illuminate\Foundation\Application( // realpath(DIR.'/../') // );

 $app = new App\MyApp(
    realpath(__DIR__.'/../')
 );

 php artisan clear-compiled
 composer dump-autoload

In MyApp I have the following :

<?php namespace App;

 use Illuminate\Foundation\Application;

 class MyApp extends Application
     {
             public function publicPath()
                 {
                 return $this->basePath.DIRECTORY_SEPARATOR.'www';
                     }
         }

With all of this configured I still get white screen with no errors. I have read around the web that maybe i need to change my directory permissions to 777. should this be everfile on the laravel project? I changed the storage/bootstrap directories and all content to 777.

I have read that the .htaccess needs to go outside of the public_html folder? also to check to see if i'm running php 5.3 or better (i dont know how to do this on directadmin). I commented out the entire index.php and successfully got it to echo 'hello world'. so i know it is pointed at the right document. is there anything that I am missing or did wrong to get this project online?

Ricki Moore
  • 1,203
  • 7
  • 27
  • 47
  • I have deployed an app on Laravel 5 as well (yesterday to be more precise), I wrote to an existing question, see if it works (hope you use git to revert if fails): http://stackoverflow.com/questions/28364496/laravel-5-remove-public-from-url/32580688#32580688 – ka_lin Sep 16 '15 at 11:01
  • what's the error you are getting? Is it just a blank screen? – Sid Sep 16 '15 at 11:13
  • yep. just a blank screen. No erros. Only once it told me that i had a internal 500 error. – Ricki Moore Sep 16 '15 at 13:00
  • Check if you have right permissions to storage folder. It should be 777 – SomethingElse Sep 16 '15 at 13:02
  • For php version you can print phpinfo(); (You either create info file or just print in index) – SomethingElse Sep 16 '15 at 13:06

1 Answers1

0

Did you change environment to 'production'? if yes that's why you are getting blank screen, because laravel hides php errors. You need to do a composer install for the project. you can't do that on shared hosting unless it supports ssh connections

Ravisha Hesh
  • 1,504
  • 13
  • 19