Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to put laravel 5.3 project on shared hosting

I made a laravel project on my localserver. I just copy the project folder and pasted on my web server in public_html folder. It's giving an error when i open it.

Forbidden

You don't have permission to access / on this server. Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

Can anyone please let me know step by step how to put my laravel project on web serve?

like image 822
prince priyadarshi Avatar asked Jan 27 '26 13:01

prince priyadarshi


1 Answers

Well there are three ways to upload and make workable on shared hosting which I came to know.

  • Rename server.php file to index.php (which is not the correct way)
  • Shift public/* to root (also, its not the correct way)
  • Need to add a line in public/index.php after initialization of $app

    $app->bind('path.public', function() {
        return _DIR_;
    });
    

and that's proper way as per my knowledge.

like image 185
Naveed Ramzan Avatar answered Jan 30 '26 01:01

Naveed Ramzan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!