【问题标题】:Problems with Code Igniter manual instalationCodeigniter 手动安装的问题
【发布时间】:2021-06-25 16:31:48
【问题描述】:

Codeigniter 4 显示此错误:SYSTEMPATH\CodeIgniter.php at line 224。 (完整的错误正文,如下)

看起来缺少 $extension intl 是问题所在。我已经编辑了 php.ini 文件, 从 ;extension=intl 中删除分号。

还是不行。知道如何解决这个问题吗?


217             {
218                 $missingExtensions[] = $extension;
219             }
220         }
221 
222         if ($missingExtensions)
223         {
224             throw FrameworkException::forMissingExtension(implode(', ', $missingExtensions));
225         }
226     }
227 
228     //--------------------------------------------------------------------
229 
230     /**
231      * Initializes Kint

Backtrace 服务器请求响应文件内存 SYSTEMPATH\CodeIgniter.php : 224 — CodeIgniter\Exceptions\FrameworkException::forMissingExtension(参数)

$extension intl

217             {
218                 $missingExtensions[] = $extension;
219             }
220         }
221 
222         if ($missingExtensions)
223         {
224             throw FrameworkException::forMissingExtension(implode(', ', $missingExtensions));
225         }
226     }
227 
228     //--------------------------------------------------------------------
229 
230     /**
231      * Initializes Kint

SYSTEMPATH\CodeIgniter.php : 172 — CodeIgniter\CodeIgniter->resolvePlatformExtensions ()

165         // Setup Exception Handling
166         Services::exceptions()->initialize();
167 
168         // Run this check for manual installations
169         if (! is_file(COMPOSER_PATH))
170         {
171             // @codeCoverageIgnoreStart
172             $this->resolvePlatformExtensions();
173             // @codeCoverageIgnoreEnd
174         }
175 
176         // Set default locale on the server
177         locale_set_default($this->config->defaultLocale ?? 'en');
178 
179         // Set default timezone on the server

SYSTEMPATH\bootstrap.php : 159 — CodeIgniter\CodeIgniter->initialize ()

152  *
153  * The CodeIgniter class contains the core functionality to make
154  * the application run, and does all of the dirty work to get
155  * the pieces all working together.
156  */
157 
158 $app = new CodeIgniter(new App());
159 $app->initialize();
160 
161 return $app;
162 
require FCPATH\index.php   —   require()

【问题讨论】:

  • 您是否编辑了正确的php.ini 文件?在.php 文件中使用phpinfo() 来显示扩展是否已加载以及要编辑哪个php.ini。进行更改后重新启动您的网络服务器
  • 你说得对,我使用的是 WAMP(不是 MAMP)php.ini 文件 -> 但行“extension=intl”在 WAMP 的 php.ini 文件中也没有分号。
  • PHP.ini 文件有两个版本。一个用于 CLI,另一个用于 Web。确保您更改的是 Web 而不是 CLI。另一个潜在问题可能是您没有安装该特定模块。
  • 请分享更多细节,比如错误信息本身

标签: php codeigniter codeigniter-4


【解决方案1】:

转到您的 php.ini 文件并取消注释 extension=intl

【讨论】:

  • 请分享更多细节,以便其他人可以从您的回答中学习。根据问题,OP已经尝试过但没有成功
猜你喜欢
  • 2021-05-10
  • 1970-01-01
  • 1970-01-01
  • 2020-06-08
  • 1970-01-01
  • 2022-01-22
  • 2013-11-18
  • 2022-01-12
  • 2019-09-15
相关资源
最近更新 更多