Internationalization 试图从全局命名空间加载类“IntlTimeZone”

Internationalization 试图从全局命名空间加载类“IntlTimeZone”,internationalization,timezone,php-7,php-extension,Internationalization,Timezone,Php 7,Php Extension,当我第一次安装symfony应用程序时,它失败了,错误如下: HTTP 500 Internal Server Error Attempted to load class "IntlTimeZone" from the global namespace. Did you forget a "use" statement? 如何修复?可以通过安装缺少的php模块来修复。 在我的例子中,使用php 7.2的ubuntu 16: sudo apt-get install php7.2-intl 可

当我第一次安装symfony应用程序时,它失败了,错误如下:

HTTP 500 Internal Server Error
Attempted to load class "IntlTimeZone" from the global namespace.
Did you forget a "use" statement?

如何修复?

可以通过安装缺少的php模块来修复。 在我的例子中,使用php 7.2的ubuntu 16:

sudo apt-get install php7.2-intl

可以通过安装php模块来修复缺失的问题。 在我的例子中,使用php 7.2的ubuntu 16:

sudo apt-get install php7.2-intl

如果使用window和composer,您可以尝试

composer require twig/extensions

这对我来说很有用。

如果使用window和composer,您可以试试

composer require twig/extensions

这对我来说很有用。

记住重新启动apache。。。如果您使用的是symfony服务器:运行restart it.sudo apt get install php intlrememember restart apache。。。如果您使用的是symfony服务器:运行restart it.sudo apt get install php intl