如何在Heroku托管的Laravel Web应用程序上安装intl extenuation for PHP

6ie5vjzr  于 2023-03-03  发布在  PHP
关注(0)|答案(1)|浏览(126)

我正在使用Nova的heroku上运行一个laravel应用程序。我已经部署好了,一切似乎都正常,但是我有一个有“价格”字段的产品模型。我收到的错误消息似乎表明Symfony中的NumberFormatter::setAttribute()函数有问题。
我在尝试呈现Product models的主列表时收到的错误如下。

The Symfony\Component\Intl\NumberFormatter\NumberFormatter::setAttribute() method's argument $attr value 2 behavior is not implemented. The available attributes are: FRACTION_DIGITS, GROUPING_USED, ROUNDING_MODE. Please install the "into" extension for full localization capabilities"

有人遇到过这个错误吗?什么可以解决它?我在heroku上使用niginx。
我的过程文件是这样的。

web: vendor/bin/heroku-php-nginx -C nginx_app.conf /public

我的nginx_app.conf文件里有这个。

location / {
    # try to serve file directly, fallback to rewrite
    try_files $uri @rewriteapp;
}

location @rewriteapp {
    # rewrite all to app.php
    rewrite ^(.*)$ /index.php/$1 last;
}

location ~ ^/(app|app_dev|config)\.php(/|$) {
    try_files @heroku-fcgi @heroku-fcgi;
    internal;
}
c9x0cxw0

c9x0cxw01#

composer require ext-intl应该可以安装intl扩展(Heroku上有,但作为可选扩展),或者您可以手动将其添加到composer.jsonrequire部分:

"ext-intl": "*",

相关问题