0

In my localhost I can run Laravel using composer without any problem. But I don't know how to move my Laravel project to live server.

I just copied all items which is in Public folder to Public_html. Then other items are placed into Laravel folder. Put this folder into Public_html. I have changed the index.php coding like this.

require __DIR__.'/laravel/bootstrap/autoload.php';
$app = require_once __DIR__.'/laravel/bootstrap/app.php';

But still my site shows

page isn’t working..is currently unable to handle this request.HTTP ERROR 500

Public_html folder like this enter image description here

Rakesh kumar Oad
  • 1,332
  • 1
  • 15
  • 24
Test sample
  • 21
  • 1
  • 2
  • 3
    Possible duplicate of [Uploading Laravel Project onto Web Server](http://stackoverflow.com/questions/22075238/uploading-laravel-project-onto-web-server) – Andy Holmes Dec 12 '16 at 09:34
  • I have tried that way also many time. But same error occurs. That is why I have changed like above. – Test sample Dec 12 '16 at 09:41
  • Not sure if it would make any difference but did you clear your config cache etc? – Andy Holmes Dec 12 '16 at 09:50
  • What I will do on config cache ? @Andy Holmes kindly explain – Test sample Dec 12 '16 at 10:02
  • `php artisan cache:clear` i don't think it'll alter your problem. Unfortunately I'm not sure on how to fix your issue, the linked question to me should fix your issues. Who are you hosting with? – Andy Holmes Dec 12 '16 at 10:05
  • Hosting with "direct admin". php artisan cache:clear .. how can I run this command on Live server ? I can done this in my localhost only.. I don't know how to do on live server – Test sample Dec 12 '16 at 10:08
  • Then you need to speak to your host about accessing the command line – Andy Holmes Dec 12 '16 at 10:26
  • Have answered a similar question at http://stackoverflow.com/questions/35461322/upload-laravel-5-to-server-subfolder/35474800#35474800 have a look, might help you. – Donkarnash Dec 12 '16 at 15:08

2 Answers2

0

if you can not provide a link to the web root of the shared folder!

  1. All except the Public folder to move to a higher level, such as a folder laravel - http://prntscr.com/bryvu7 (Maybe on hosting your folder - public. not a folder public_html)

  2. Change file publi_html/index.php line

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

to

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

And line

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

to

$app = require_once __DIR__.'/../laravel/bootstrap/app.php';
$app->bind('path.public', function() {
    return __DIR__;
});
  1. Change file laravel/server.php line

    require_once __DIR__.'/public/index.php';

to

require_once __DIR__.'/index.php';
Ilya Yaremchuk
  • 2,007
  • 2
  • 19
  • 36
  • I have changed as like you told now. But still shows same "page isn’t working.. is currently unable to handle this request. HTTP ERROR 500" – Test sample Dec 12 '16 at 10:25
0

This error you can get due to vendor folder missing in live server Please follow this is this answer. Link

Parveen Chauhan
  • 1,396
  • 12
  • 25