Installing PHP extension ‘intl’ on a PHP Docker image.

huangapple go评论77阅读模式
英文:

Installing PHP extension 'intl' on a PHP Docker image

问题

I'm having trouble installing the intl extension on the official php:8.1-apache Docker image running on Debian.

I've tried running the following commands:

apt install cron coreutils g++ zip unzip icu-dev libicu-dev libpng-dev libxml2-dev libzip-dev libonig-dev libxslt-dev php8.1-intl -y
docker-php-ext-configure intl
docker-php-ext-install pdo pdo_mysql mysqli gd opcache intl zip calendar dom mbstring xsls
docker-php-ext-enable intl
echo "extension=intl" >> /usr/local/etc/php/conf.d/docker-php-ext-intl.ini

I´m tested not all at once.
However, none of these solutions have worked for me. Can anyone suggest the correct configurations for this image? Thanks in advance for your help.

Some error logs on running

Warning: PHP Startup: Unable to load dynamic library 'intl' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20210902/intl (/usr/local/lib/php/extensions/no-debug-non-zts-20210902/intl: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20210902/intl.so (/usr/local/lib/php/extensions/no-debug-non-zts-20210902/intl.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

英文:

I'm having trouble installing the intl extension on the official php:8.1-apache Docker image running on Debian.

I've tried running the following commands:

apt install cron coreutils g++ zip unzip icu-dev libicu-dev libpng-dev libxml2-dev libzip-dev libonig-dev libxslt-dev php8.1-intl -y
docker-php-ext-configure intl
docker-php-ext-install pdo pdo_mysql mysqli gd opcache intl zip calendar dom mbstring xsls
docker-php-ext-enable intl
echo "extension=intl" >> /usr/local/etc/php/conf.d/docker-php-ext-intl.ini

I´m tested not all at once.
However, none of these solutions have worked for me. Can anyone suggest the correct configurations for this image? Thanks in advance for your help.

Some error logs on running

> Warning: PHP Startup: Unable to load dynamic library 'intl' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20210902/intl (/usr/local/lib/php/extensions/no-debug-non-zts-20210902/intl: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20210902/intl.so (/usr/local/lib/php/extensions/no-debug-non-zts-20210902/intl.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

答案1

得分: 2

以下是翻译好的部分:

"我不确定为什么那时候它没有工作。显然,我在某个地方卡住了。以下命令完美运行:

apt install libicu-dev -y
docker-php-ext-install intl
docker-php-ext-enable intl"

英文:

I'm not sure why it didn't work back then. Apparently, I got stuck somewhere. The following commands work perfectly:

apt install libicu-dev -y
docker-php-ext-install intl
docker-php-ext-enable intl

huangapple
  • 本文由 发表于 2023年4月13日 16:23:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/76003238.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定