CI4开始
刚刚下载的CI4框架安装包,配置好apache服务器,第一次运行就开始报错,头大

经过一番搜索,终于成功解决:
1、将框架模式改为开发模式
E:\www\CI-test\system\CodeIgniter.php 打开文件,找到,将“production”改为"development"。
方法一:
/** * You can load different configurations depending on your * current environment. Setting the environment also influences * things like logging and error reporting. * * This can be set to anything, but default usage is: * * development * testing * production * * @codeCoverageIgnore */ protected function detectEnvironment() { // Make sure ENVIRONMENT isn't already set by other means. if (! defined('ENVIRONMENT')) { define('ENVIRONMENT', env('CI_ENVIRONMENT', 'production')); } }
方法二:
找到E:\www\CI-test\app\Config\Boot\production.php
/*
 |--------------------------------------------------------------------------
 | ERROR DISPLAY
 |--------------------------------------------------------------------------
 | Don't show ANY in production environments. Instead, let the system catch
 | it and display a generic error message.
 */
ini_set('display_errors', '0');  //将0改为1,一样可以显示错误信息
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
2、刷新页面,会弹出详细错误信息

提示PHP7.4需要安装intl。
接着修改php.ini,将
extension=intl前面的注释去除掉就好。
 
                    
                     
                    
                 
                    
                
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号