Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the correct steps to deploy a production laravel 5.2 app?

I am using laravel 5.2 to develop app.
As of now I am using php -S localhost:8888 -t public to deploy the test development app.
I know that I have to change configuration file .env for production.
But itseams I can't use php artisan serve or php -S localhost:8888 -t public to deploy the app as production app.
I am using WAMP in my machine. Currently I placed my laravel app in C:\wamp\www\laravel.
What are the correct steps to deploy my laravel 5.2 app?

like image 229
Kumaran Avatar asked Feb 11 '16 05:02

Kumaran


1 Answers

php artisan serve creates a local, development, very basic HTTP server and is not for production. It won't handle more than a handful of visits and will break quickly, and isn't secured in the way Apache or Nginx are.

Based on your directory path C:\wamp\www\laravel, I guess you are using a WAMP server? The A in WAMP is Apache - the web server you use instead of php artisan serve.

Setting up the site on a production server will vary based on your setup, but the general steps will look like:

  • You should just put your project files straight into in your WAMP directory
  • Run composer install to install the dependencies.
  • Edit the database and other vars in your .env file.

Ensure that WAMP is running and the site is configured and you should should be good to go.

If you don't have much server experience and just want to securely and simply host a Laravel app, I would strongly suggest checking our Laravel Forge - it does everything and your site will be on the public Internet within 10 minutes.

like image 154
samiles Avatar answered Oct 20 '22 09:10

samiles