安装PHP8.4时报错

configure: symlinking en_US.UTF-8 messages to en_US in case you are on musl
checking for ngettext in -lc… yes
checking for dngettext in -lc… yes
checking for dcngettext in -lc… yes
checking for bind_textdomain_codeset in -lc… yes
checking for GNU MP support… no
checking for mhash support… yes
configure: WARNING: The --with-mhash option and mhash* functions are deprecated as of PHP 8.1.0
checking size of long… (cached) 8
checking if we’re at 64-bit platform… yes
checking for iconv support… yes
checking for iconv… yes
checking for iconv implementation… glibc
checking if iconv supports errno… yes
checking if iconv input parameter is const (non-standard)… non-const
checking if iconv supports //IGNORE… no
checking whether to enable internationalization support… yes
checking for icu-uc >= 50.1 icu-io icu-i18n… no
configure: error: Package requirements (icu-uc >= 50.1 icu-io icu-i18n) were not met:

Package ‘icu-uc’ not found
Package ‘icu-io’ not found
Package ‘icu-i18n’ not found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables ICU_CFLAGS

and ICU_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
make: *** No targets specified and no makefile found. Stop.
install php
make: *** No rule to make target ‘install’. Stop.

操作系统: Ubuntu

版本号: 26.04
系统架构: x86_64

OS_NAME: Ubuntu

OS_VERSION: 26.04
OS_ARCH: x86_64

错误: php {8.4.21} {install} 失败!

ERROR: php {8.4.21} {install} Failed!
安装失败,请前往以下链接截图求助:
Installation failed. Please go to the link above and ask for help with a screenshot.

ERROR: php {8.4.21} {install} Failed!
错误: php {8.4.21} {install} 失败!
exit_code: 1
※Operator failed※

这是PHP编译安装时缺少ICU库依赖导致的错误。问题原因:
PHP的国际化(intl)扩展需要ICU库,但系统没有安装ICU开发包,导致configure失败,没有生成Makefile。解决方案:在Ubuntu上安装ICU开发库:code.shsudo apt updatesudo apt install libicu-dev安装完成后,重新运行PHP的configure命令即可。如果你使用的是PHP编译安装脚本,可能需要先安装完整依赖:code.shsudo apt install -y \ build-essential \ libicu-dev \ pkg-config然后再重新执行PHP安装命令。

这个问题我们也会优化下,您可以添加我们联系方式,我们后续优化了也会通知您:alpha-null