gpt4 book ai didi

PHP7.2 缺少国际扩展

转载 作者:行者123 更新时间:2023-12-03 23:21:29 25 4
gpt4 key购买 nike

我正在尝试运行使用 locale_accept_from_http 的 php 应用程序从国际扩展功能。我的php版本是7.2我收到一个错误:Call to undefined function locale_accept_from_http() ;

我在尝试:

1.安装扩展sudo apt-get install php-intl .
错误是:

Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:

The following packages have unmet dependencies: php-intl : Depends: php7.1-intl but it is not going to be installed E: Unable to correct problems, you have held broken packages.



2. 在 php.ini 中启用 intl 扩展。
我收到警告:

PHP Warning: PHP Startup: Unable to load dynamic library 'intl'



将这个扩展与 php7.2 一起使用的正确方法是什么? ?

最佳答案

正如它在您的错误中所述,您的软件包已损坏,因此在这种情况下,您应该尝试修复它,可能以下命令会修复它们。

apt update
apt autoremove

一旦你解决了这个问题,如果你没有添加 ondrej PPA,你可以尝试执行以下命令:
add-apt-repository -y ppa:ondrej/php
apt install php7.2 php7.2-intl

关于PHP7.2 缺少国际扩展,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53921992/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com