简体   繁体   中英

Deploying Laravel to Live Server

I have a shared linux live server that has been purchasing for hosting of website. I have checked the configuration, and saw a section for framework in the Cpanel.Laravel is there. If it is clicked, it will download the framework. Now, I like to know if my already written laravel application working perfectly in my localhost can be deployed to the live server? If yes, how can this done? Will I just copy all the files into my www directory or what? Or will I have to rewrite the code directly on the web again. If this is the option, how will i use those Artisan command?

Please, I a new to deployment of laravel framework.

on shared hosting you can not run artisan commands, you can not enjoy all laravel features on shared hosting, you need vps or dedicated server, on shared hosting you need to do so much manual work, like old php site uploading, and database update, any ways if you want to upload laravel project on shared hosting follow these steps.

  1. create a directory name framework on your hosting root and upload everything from your local to framework directory except public directory.
  2. upload all content from public directory in www directory on your host.
  3. now modify your index.php file

Go to index.php and edit the line 22

#From this
require __DIR__.'/../bootstrap/autoload.php';
#To this
require __DIR__.'/../[framework-folder]/bootstrap/autoload.php';

And the line 36

#From this 
$app = require_once __DIR__.'/../bootstrap/app.php';
#To this
$app = require_once __DIR__.'/../[framework-folder]/pulcro/bootstrap/app.php';
  1. modify your .env file put your database credentials

now browse your app.

for more information read this forum post.

http://laravel.io/forum/03-06-2015-how-to-setup-laravel-5-in-shared-hosting

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM