在安装php7.3-intl时,debian docker出现“没有安装候选项”的错误提示。

5

我通过docker-compose安装了WordPress。它使用php7.3(我已经检查了版本)。现在问题是这样的:wp函数使用Locale类 -> 需要启用php_intl(在php.ini中未找到) -> 尝试安装php7.3-intl -> 出错。

Package php7.3-intl is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'php7.3-intl' has no installation candidate

我尝试了这些网站中提到的解决方案:https://computingforgeeks.com/how-to-install-php-7-3-on-debian-9-debian-8/https://ayesh.me/Ubuntu-PHP-7.2Can't get to install 'intl' extension for php on debian。最终,我在最后一个链接中遇到了以下错误:

/tmp/pear/temp/intl/intl_error.h:24:10: fatal error: ext/standard/php_smart_str.h: No such file or directory

我尝试了nano /tmp/pear/temp/intl/intl_error.h,但路径不存在。另外,当被问到Specify where ICU libraries and headers can be found [DEFAULT]时,我只是按了回车键。
接下来该怎么做?或者有更好的方法来解决我的原始问题吗?
1个回答

9

我曾经遇到过同样的问题,我通过在容器内运行以下命令来解决:

docker-php-ext-install intl

1
使用Debian安装前面的“apt-get install libicu-dev”命令。 - Jose Fanjul

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接