作曲家 PHP 警告:PHP 启动:无法加载动态库'intl'错误



我正在尝试执行命令"作曲家安装"命令。但是收到此错误:

PHP Warning:  PHP Startup: Unable to load dynamic library 'intl' (tried: ./ext/intl (The specified module could not be found.), ./ext/php_intl.dll (The specified module could not be found.)) in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'intl' (tried: ./ext/intl (The specified module could not be found.), ./ext/php_intl.dll (The specified module could not be found.)) in Unknown on line 0
PHP Warning:  Module 'pdo_mysql' already loaded in Unknown on line 0
Warning: Module 'pdo_mysql' already loaded in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'intl' (tried: ./ext/intl (The specified module could not be found.), ./ext/php_intl.dll (The specified module could not be found.)) in Unknown on line 0
PHP Warning:  Module 'pdo_mysql' already loaded in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'intl' (tried: ./ext/intl (The specified module could not be found.), ./ext/php_intl.dll (The specified module could not be found.)) in Unknown on line 0
Warning: Module 'pdo_mysql' already loaded in Unknown on line 0
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested PHP extension ext-intl * is missing from your system. Install or enable PHP's intl extension.

这是我的PHP INI文件。我删除了";"来自" 扩展=intl",但它仍然给我错误

;extension=bz2
extension=curl
extension=fileinfo
extension=gd2
;extension=gettext
;extension=gmp
extension=intl
;extension=imap
;extension=interbase
;extension=ldap
extension=mbstring
;extension=exif      ; Must be after mbstring as it depends on it
;extension=mysqli
;extension=oci8_12c  ; Use with Oracle Database 12c Instant Client
;extension=odbc
extension=openssl
;extension=pdo_firebird
;extension=pdo_mysql
;extension=pdo_oci
;extension=pdo_odbc
;extension=pdo_pgsql
;extension=pdo_sqlite
;extension=pgsql
;extension=shmop

只需将 icu*63.dll 或 icu*68.dll(对于 PHP 8(文件从 php 目录复制到 apache24/bin

它适用于Apache + PHP 8.0.0 x64 + intl

如果您使用 PHP v7.3.2,则在此链接中报告了一个关于加载动态库 intl 的错误。

我在Windows服务器上从php7.4迁移到php8.1时遇到了类似的问题。解决方案是在 PATH 环境变量中添加 php8 目录的路径和 php8 ext 目录的路径。

最新更新