Laravel 5.3. How to configure a production environment?
Asked Answered
N

2

12

I got started with Laravel 5.3 and I got my development environment working on local, but now I need to upload the app to production server. I cant found nothing about configuring two environments on same app.

I use Apache web server on both (local and production).

Any guide/doc is well received!

Nivernais answered 25/9, 2016 at 19:16 Comment(0)
N
15

The docs (as pointed by Marcin) suggest to use the .env file to configure your environment. Different environments = different .env files. Thus, on local machine you'd have an .env file with your local enviroment configuration, and on production you'd have a different .env file, and a diffrent one for staging, and so on... APP_ENV=production

Which can be brought forth with App::environment()

Remember to exclude the .env from versioning, cheers.

Nebraska answered 25/9, 2016 at 20:4 Comment(0)
R
-1

Better to follow this blog:

https://devmarketer.io/learn/deploy-laravel-5-app-lemp-stack-ubuntu-nginx/

With that blog, if you're not using Nginx but Apache, that's fine because we are more concerned with the Laravel configuration and permissionings on files and folders than the web server.

Recombination answered 17/5, 2018 at 2:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.