intl php 扩展异常 zend framework 2 共享主机

intl php extension exception zend framework 2 shared hosting

我终于设法将我的 ZF2 站点部署到共享(也是免费)托管。

一切似乎都在以正确的方式工作,除了有一个表单的部分。 这是我收到的错误:

Uncaught exception 'Zend\Form\Exception\ExtensionNotLoadedException'
with message 'Zend\Form\View\Helper component requires the intl PHP extension' in
/.../vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormMonthSelect.php

在表单中,有一个字段供用户 select his/her 生日。我认为问题就在那里。

我应该如何在服务器中启用该扩展?或者至少,修改我的 zf2 应用程序中的某些内容,使其不需要该扩展名?

您的诊断是正确的 -- FormMonthSelect does require intl 分机。

管理 php 扩展通常由系统管理员完成,因此您要么要求托管公司启用它,要么尝试通过 htaccess 将其压缩(不确定,edit .htaccess to load php extension?)。除此之外,我只能建议不要使用任何依赖于 intl 的东西,所以也许是一个简单的文本字段,由您手动完成日期解析。