When we work with any application, always work in development mode means first start your debug mode. It’s because while application compiles, you will get the error if your code will have.
When we install CodeIgniter 4, we have env file at root. To use the environment variables means using variables at global scope we need to do env to .env
Open project in terminal
cp env .env
Above command will create a copy of env file to .env file. Now we are ready to use environment variables.
Turn Development Mode
By default you will see in .env file –
CI_ENVIRONMENT = production
Environment is in production. So in this case, you will not be able to see errors when you get.
Do it to –
CI_ENVIRONMENT = development
Now application is in development mode.
Hi, I am Sanjay the founder of Online Web Tutor. I welcome you all guys here to join us. Here you can find the web development blog articles. You can add more skills in web development courses here.
I am a Web Developer, Motivator, Author & Blogger. I also used to take online classes including tech seminars over web development courses. We also handle our premium clients and delivered up to 50+ projects.