Laravel 5 How to switch from Production mode

Stefan Izdrail

Founder & Senior Architect · 2026-06-29

Laravel Company
Title: Easily Switching Between Application Environments in Laravel 5 Laravel is a fascinating PHP framework with several modes to tailor your application depending on the environment it operates in. However, for some users or newbies, switching between these modes can be overwhelming at first glance. But fear not; this blog post will guide you through the process of switching from the Production mode to other modes such as Development or testing environments, making it more accessible and manageable. The Laravel configuration file (`.env`) controls your application's environment settings. When you run $ php artisan env, you get an output that displays the current working environment of your application. The documentation from Laravel's website can be a great resource for learning more about these configurations, but it might not always be easy for someone who is new to server configuration or has limited experience with such things. In this blog post, we will focus on changing the environment without worrying too much about more advanced aspects of server configuration. Our primary interest is in manually switching between modes. To do so, follow these steps: 1. Open your Laravel project's root directory and locate the `.env` file, usually found in the root directory with all other application files. 2. Within this file, you will see a line that reads: APP_ENV=production. This specifies your current environment as Production mode. 3. To switch to Development or another mode, change `APP_ENV` to any appropriate value. For example, if you wish to use the development environment, set the line to read: APP_ENV=development. You can also use other modes like testing (APP_ENV=testing) or staging (APP_ENV=staging). 4. Save your changes in the `.env` file, and restart your Laravel application if necessary. Now when you run $ php artisan env, your application environment should be changed to the new value specified earlier. You may experience differences between the Production and Development modes, such as error reporting or debugging features. These vary depending on the mode you choose for your project. In summary, switching between Laravel's application environments is not as complicated as it might seem at first glance. By understanding the role of the `.env` file and making simple changes to its contents, you can easily switch between modes like Production, Development, or others that better suit your specific needs. For more comprehensive information about Laravel configuration, consider referring to https://laravelcompany.com/blog/category/laravel-tutorials/, where we provide detailed tutorials and articles that can help you master the framework effectively. Remember that this blog post is merely an introduction to switching environments in Laravel 5. Always refer to official documentation for more advanced configurations according to your needs and level of experience with server configuration.