whatever error occurs in Codeigniter 4 Its always showing default message
How to get exact error message in Codeigniter 4
whatever error occurs in Codeigniter 4 Its always showing default message
How to get exact error message in Codeigniter 4
Rename the env file as .env, then removed # from CI_ENVIRONMENT and modified
CI_ENVIRONMENT = production
into
CI_ENVIRONMENT = development
Add this code to the index.php file at the top. Final Solution
define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development');
Follow the following guidlines from docs
Copy or rename the env file to .env. Open it up.
Uncomment the line with
CI_ENVIRONMENTon it, and changeproductiontodevelopment
CI_ENVIRONMENT = development
and
Set the base url properly if you are not using PHP's built-in server
app/config/App.php
public $baseURL = 'http://localhost/path_to_CI/public';
Don't forget to rename :
env
to
.env
And uncomment #CI_ENVIRONMENT = development to CI_ENVIRONMENT = development
go to .env file in base file uncomment #CI_ENVIRONMENT = development to CI_ENVIRONMENT = development
There are something you need to Debug
env file to .envAfter Rename open the .env file. it looks like this.
Change this line
# CI_ENVIRONMENT = production
to
CI_ENVIRONMENT = development
After that try to create an error, then you will see error page like below.
Go to your directory project and open .env file
Change this
CI_ENVIRONMENT = production
To this
CI_ENVIRONMENT = development