Muhafid
Muhafid

Reputation: 1

The error view files were not found. Cannot render exception trace. Code Igniter 4

I can't access my local host (http://localhost:8081/).

Error:

The error view files were not found. Cannot render exception trace.

Upvotes: 0

Views: 2830

Answers (3)

codelone
codelone

Reputation: 762

The error is occurring in your view file but isn't being displayed on screen. To troubleshoot, add logging statements at potential error points:

log_message('error', 'Error message: ' . $e->getMessage());

Then check your logs in the writable/log/ directory to identify the specific issue.

Upvotes: 0

JWC May
JWC May

Reputation: 654

Download CI 4.0 and open Views directory and find 'errors' folder then upload 'errors' directory into the existing project's views

Upvotes: 0

steven7mwesigwa
steven7mwesigwa

Reputation: 6730

This error comes from a "missing error view file".

  1. Make sure you have all relevant files & directories under app/Views/errors/.
├───app
|   |
│   └───Views
        └───errors
            ├───cli
            │       error_404.php
            │       error_exception.php
            │       production.php
            │
            └───html
                    debug.css
                    debug.js
                    error_404.php
                    error_exception.php
                    production.php
  1. Ensure that the configuration variable below in the file app/Config/Exceptions.php is set correctly.
    /**
     * --------------------------------------------------------------------------
     * Error Views Path
     * --------------------------------------------------------------------------
     * This is the path to the directory that contains the 'cli' and 'html'
     * directories that hold the views used to generate errors.
     *
     * Default: APPPATH.'Views/errors'
     *
     * @var string
     */
    public $errorViewPath = APPPATH . 'Views/errors';

Upvotes: 0

Related Questions