Topic: Staticly compile ICU lib for intl extention
Hello,
I'm currently building PHP 5.4 from source and I enabled the intl extention for IDN functions,
i'm doing the builds using docker containers for CentOS 6,
where i start a CentOS6 container
docker run -it --rm --name=builder$(date +%s) --hostname=builder$(date +%s) -e HTTPD_VERSION=2.2.31 -e PHP_VERSION=5.4.45 centos:6
then I call 2 scripts to build Apache and PHP
build-php
#!/bin/bash
set -e
set -u
name='php'
version="${PHP_VERSION:-5.5.33}"
php_file="${name}-${version}.tar.gz"
build_dir="/tmp/builder-$(date +%s)"
php_download_link="il1.php.net/distributions/${php_file}"
num_cpus=$(grep -c "^processor" /proc/cpuinfo) # useful for parallel building
install_packages() {
rpm -Uivh hxxps :// dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm || /bin/true
rpm -Uivh hxxp :// rpms.remirepo.net/enterprise/remi-release-6.rpm || /bin/true
yum install -y yum-utils
yum-config-manager --enable remi
yum install -y gcc gcc-c++ autoconf libxml2-devel perl bison re2c libcurl-devel apr-util-devel apr-devel libicu-last-devel
#libicu-devel
}
download_and_extract() {
mkdir -p "${build_dir}" && cd "${build_dir}"
curl -s "${php_download_link}" | tar -C "${build_dir}" -xzvf -
}
configure_make_install() {
if ! cd "${build_dir}/${name}-${version}"
then
echo -e "cant cd into build folder [${build_dir}/${name}-${version}]"
echo "exit 1"
exit 1
else
# configure
conf_parm="--prefix=/usr/local/lib/php5" # root folder to install to
conf_parm+=" --enable-debug=no" # DO NOT Compile with debugging symbols
conf_parm+=" --enable-maintainer-zts" # Enable thread safety - for code maintainers only!!
conf_parm+=" --enable-pdo" # not used in version 5.5 ?
conf_parm+=" --enable-shared" # ?
conf_parm+=" --enable-xml" # ?
conf_parm+=" --with-curl" # Include cURL support
conf_parm+=" --with-apxs2=/usr/local/lib/apache2/bin/apxs" # Build shared Apache 2.0 Handler module. FILE is the optional pathname to the Apache apxs tool apxs
conf_parm+=" --with-config-file-path=/usr/local/etc/php5" # Set the path in which to look for php.ini [PREFIX/lib]
conf_parm+=" --with-zlib" # Include ZLIB support (requires zlib >= 1.0.9)
conf_parm+=" --enable-intl" # Enable internationalization support / IDN
./configure ${conf_parm} && make -j$((num_cpus+1)) && make install
fi
}
install_packages
download_and_extract
configure_make_install
After that I take the folder /usr/local/lib tar-gzip it and copy it to my testing environment,
but when i try to use it, i get this error message,
Cannot load /usr/local/lib/apache2/modules/libphp5.so into server: libicui18n.so.50: cannot open shared object file: No such file or directory
And I'm asking this because i can't install the libicu from Remi repo on my system (this is a restriction i have) and i do not want to compile it my self. so this is why i ask if i can compile the libicu staticly into libphp5.so ?
thanks in advance,