【问题标题】:Attempted to load class "IntlTimeZone" from the global namespace试图从全局命名空间加载类“IntlTimeZone”
【发布时间】:2018-09-19 13:18:14
【问题描述】:

当我第一次安装 symfony 应用程序时,它大声失败并出现错误:

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

如何解决?

【问题讨论】:

    标签: internationalization timezone php-7 php-extension


    【解决方案1】:

    可以通过安装缺少的 php 模块来修复。 在我的情况下,ubuntu 16 上带有 php 7.2:

    sudo apt-get install php7.2-intl
    

    【讨论】:

    • 记得重启 apache... 如果你使用的是 symfony 服务器:运行重启它。
    • sudo apt-get install php-intl
    【解决方案2】:

    如果使用window和composer可以试试

    composer require twig/extensions
    

    这对我有用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-10-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-21
      • 1970-01-01
      相关资源
      最近更新 更多