【发布时间】:2019-06-16 06:42:08
【问题描述】:
我正在尝试在 PHP 7.2.13 版上使用 idn_to_ascii(),但我收到了:
Uncaught Error: Call to undefined function idn_to_ascii()
我没有安装PECL intl扩展,但是根据top user contributed note on the documentation,我不需要它:
"...if you have >=5.4 you will not require the PECL extensions. "
用户注释错了吗?如果不是,那我做错了什么?
【问题讨论】:
-
参见php.net/manual/en/intl.installation.php,它是捆绑的,但必须在安装时明确启用。
-
您可能必须安装 php7-intl。该数字可能会根据您的系统和可用的软件包而有所不同。
-
@deceze 谢谢 - 所以用户注释是错误的?
-
不,这是正确的,您不需要 PECL 扩展。这并不意味着它总是自动可用。
-
@deceze 好的,谢谢。我知道我需要捆绑的 intl 扩展(因此不是 PECL 扩展,而是一个扩展)。但是我认为应该在某个地方明确表示我错了吗?确切的信息在哪里告诉我我需要启用 intl 扩展?