Whoops! We seem to have hit a snag. Please try again later

前端 未结 11 2870
死守一世寂寞
死守一世寂寞 2021-02-20 06:50

Whoops! We seem to have hit a snag. Please try again later.

Codeigniter 4 shows an error when I run the CI4 application, Ho

相关标签:
11条回答
  • 2021-02-20 07:17

    In your CI4 project root, create a file named .env. It should be in the same directory as system, app e.t.c

    Then, add this CI_ENVIRONMENT = development

    0 讨论(0)
  • 2021-02-20 07:18

    I got the answer for this query; just follow these steps:

    1. From the command line, at your project root just hit this php spark serve

    2. Then hit this on your browser http://localhost:8080/

    Enjoy your Latest CI.

    0 讨论(0)
  • 2021-02-20 07:20

    Assume that your root folder of your CI4 project is rootproject. Edit rootproject/.env file. On line 17 change from:

    #  CI_ENVIRONMENT = production
    

    to:

    CI_ENVIRONMENT = development
    

    Save it.

    Refresh your browser that pointing to your CI4 project. It should give you many error messages.

    If there is something written as CacheException, than your cache folders are not writable. Make it writable;

    Ubuntu:

    chown -Rv www-data rootproject/writable
    

    CentOS:

    chown -Rv apache rootproject/writable
    

    Easy way:

    chmod 777 -Rv rootproject/writable
    
    0 讨论(0)
  • 2021-02-20 07:26

    After installing CodeIgniter 4 when you run the app then you will get an error like this

    To know the error go to the app/Config/Boot/production.php and set display_errors to 1 as below

    ini_set('display_errors', '1');

    Now, you will see the actual error below

    Nothing to worry about it. The app needs permission. Assign the permission like as below

    sudo chmod -R 777 project_name

    0 讨论(0)
  • 2021-02-20 07:26

    For those using XAMPP in MacOS:

    You don't need to change the ownership of the writable directory. You only need to change permission to entire directory:

    chmod -R 777 writable
    
    0 讨论(0)
  • 2021-02-20 07:30

    This work for me try it Go to app directory then to boot directory you will see production.php file.

    That is: app => Config => Boot => production.php

    Change the ini_set('display_errors', '0') to ini_set('display_errors', '1').

    Warning: When in production change back to initial ini_set('display_errors', '0')

    Or

    you can rename your file env in your project directory to .env after that open it and edit. Search for # CI_ENVIRONMENT = production remove # and change production to development

    0 讨论(0)
提交回复
热议问题