Summary
If you’d like to use intl
module (--enable-intl
) and try to compile PHP 5.x on Ubuntu 20.04(Focal), it fails. Since Ubuntu 18.10 libicu installed via package manager (apt) does not include icu-config
.
What you have to do is install appropriate version of ICU on Ubuntu 20.04 by yourself and specify it with --with-icu-dir
configure option.
As far as I know, you need to install an old version of following two libraries in order to compile PHP 5.x on Ubuntu 18.10 or later.
- openssl (see my blog Compile PHP 5.x with Ubuntu18.04 Bionic)
- ICU (explained in this article)
Steps - Overview
- Download ICU version 60.x
- Install the ICU into version specific directory (i.e
/usr/local/icu-x
) - Configure PHP 5.x with
--with-openssl
&--with-icu-dir
options.
Steps - Detail
1. Download ICU version 60.x
http://site.icu-project.org/download/60#TOC-ICU4C-Download
1 | $ cd /usr/local/src |
[Note] Version 61.x or higher will not work compiling PHP 5.x, make sure to download 60.x.
2. Install the ICU into version specific directory
1 | $ cd /usr/local/src/icu-release-60-3/icu4c/source/ |
3. Configure PHP 5.4.45
1 | $ cd /usr/local/src |
Misc
configure error message
Following message will be shown when you specify --enable-intl
option with system default ICU.
1 | checking whether to enable internationalization support... yes |
libicu in Ubuntu 20.04
1 | $ apt info libicu-dev |
libicu deprecated icu-config
since version 61.x. But if you don’t specify --disable-icu-config
option, icu-config
will be installed even with the latest version of ICU 66.1. I think Ubuntu intentionally specify --disable-icu-config
to eliminate obsolete way of ICU uses.
[Download ICU 63 - ICU - International Components for Unicode]*(http://site.icu-project.org/download/63)
The icu-config tool has been deprecated. You can use the –disable-icu-config option to disable icu-config from being installed. Alternately, you can use –enable-icu-config to enable icu-config. In the future, icu-config will be disabled by default. (#62845)