Euler22.03版本安装php7.2报错

系统版本为Euler23.03(LTS-SP4),源码安装php7.2,执行make -j 4时报错


这情况一般是icu导致可以参考以下安装代码进行处理

	icu4cVer=$(/usr/bin/icu-config --version)
	if [ ! -f "/usr/bin/icu-config" ] || [ "${icu4cVer:0:2}" -gt "60" ];then
		wget -O icu4c-60_3-src.tgz ${download_Url}/src/icu4c-60_3-src.tgz
		tar -xvf icu4c-60_3-src.tgz
		cd icu/source
		./configure --prefix=/usr/local/icu
		make -j${cpuCore}
		make install
		[ -f "/usr/bin/icu-config" ] && mv /usr/bin/icu-config /usr/bin/icu-config.bak 
		ln -sf /usr/local/icu/bin/icu-config /usr/bin/icu-config
		echo "/usr/local/icu/lib" > /etc/ld.so.conf.d/zicu.conf
		ldconfig
		cd ../../
		rm -rf icu
		rm -f icu4c-60_3-src.tgz 
	fi

if [ “${php_version}” == “71” ] || [ “${php_version}” == “72” ] || [ “${php_version}” == “73” ];then
export CXX=“g++ -DTRUE=1 -DFALSE=0”
export CC=“gcc -DTRUE=1 -DFALSE=0”

    if [ "${PM}" == "yum" ] || [ "${PM}" == "dnf" ] ; then
        icu_v=$(rpm -q icu |cut -f 2 -d "-" |cut -d '.' -f1)
    elif [ "${PM}" == "apt-get" ]; then
        icu_v=$(dpkg -l|grep -oE libicu[0-9][0-9]|grep -oE [0-9][0-9])
    fi
    
    if [ "${icu_v}" -gt "70" ];then
        wget -O /www/server/php/${php_version}/src/ext/intl/breakiterator/codepointiterator_internal.cpp https://download.bt.cn//patch/php/debian-12-php-71-codepointiterator_internal.cpp
        wget -O /www/server/php/${php_version}/src/ext/intl/breakiterator/codepointiterator_internal.h https://download.bt.cn//patch/php/debian-12-php-71-codepointiterator_internal.h
    fi

也可以直接安装宝塔面板 是支持编译php-7.2的