Phpbrew: The INTL extension of PHP older than 7.4 cannot be compiled on Ubuntu 19.04

Created on 27 Jul 2019  ·  6Comments  ·  Source: phpbrew/phpbrew

$ phpbrew --debug install 7.3.7 +neutral +intl
===> phpbrew will now build 7.3.7
---> Parsing variants from command arguments '+neutral +intl'
===> Loading and resolving variants...
Checking distribution checksum...
Checksum matched: c3608fa7114642725854119ccffe722f42fc7c31e5e4c00d5cb4cb1a0d16bf18
===> Distribution file was successfully extracted, skipping...
Source Directory: /home/morozov/.phpbrew/build/php-7.3.7
Found existing Makefile, running make clean to ensure everything will be rebuilt.
You can append --no-clean option after the install command if you don't want to rebuild.
===> Running make clean: /usr/bin/make -C '/home/morozov/.phpbrew/build/php-7.3.7' --quiet 'clean'
Running Command:/usr/bin/make -C '/home/morozov/.phpbrew/build/php-7.3.7' --quiet 'clean'
Writing variant info to /home/morozov/.phpbrew/php/php-7.3.7/phpbrew.variants
===> Checking patches...
Checking patch for replace apache php module name with custom version name
Enabled variants: [intl, xml, opcache]
Disabled variants: []
Found existing build.log, renaming it to /home/morozov/.phpbrew/build/php-7.3.7/build.log.1564222024
===> Configuring 7.3.7...


Use tail command to see what's going on:
   $ tail -F /home/morozov/.phpbrew/build/php-7.3.7/build.log


./configure '--cache-file=/home/morozov/.phpbrew/cache/config.cache' '--prefix=/home/morozov/.phpbrew/php/php-7.3.7' '--with-config-file-path=/home/morozov/.phpbrew/php/php-7.3.7/etc' '--with-config-file-scan-dir=/home/morozov/.phpbrew/php/php-7.3.7/var/db' '--enable-intl' '--with-icu-dir=/usr' '--enable-dom' '--enable-libxml' '--enable-simplexml' '--enable-xml' '--enable-xmlreader' '--enable-xmlwriter' '--with-xsl' '--with-libxml-dir=/usr' '--enable-opcache' >> /home/morozov/.phpbrew/build/php-7.3.7/build.log 2>&1
Error: Configure failed:
The last 5 lines in the log file:
checking for Firebird support... no

checking whether to enable internationalization support... yes

checking for location of ICU headers and libraries... checking for pkg-config... /usr/bin/pkg-config

not found

configure: error: Unable to detect ICU prefix or /usr/bin/icu-config failed. Please verify ICU install prefix and make sure icu-config works.

Please checkout the build log file for more details:
     tail /home/morozov/.phpbrew/build/php-7.3.7/build.log

Should be related to the Debian Bug #898820.

The problem is fixed in PHP 7.4 (https://github.com/php/php-src/pull/3701).

Extension Installer

Most helpful comment

As a workaround, I compiled ICU and copied ico-config to /usr/bin.

See this gist for icu-config for Ubuntu 20.04 LTS.

All 6 comments

I think the same patch should have done that too? Try ‘phpbrew ext install intl’

Interestingly, I can install INTL as a shared extension using phpbrew ext install intl but I cannot compile PHP with it as I used to on Ubuntu 16.04.

How do you think is the patch for ext/gd/config.m4 relevant to ext/intl/config.m4?

@rjocoleman

I'm not sure sorry, I don't use this extension in my projects, I was mistaken on my comment on the other issue.

As a workaround, I compiled ICU and copied ico-config to /usr/bin.

See this gist for icu-config for Ubuntu 20.04 LTS.

Took me a moment to understand what @jasny meant. Hereby the for-dummies:

  • Take the raw script and save it on your machine:

    • curl https://gist.githubusercontent.com/jasny/e91f4e2d386e91e6de5cf581795e9408/raw/16e2c42136eb3f214222c80d492e71942b77f174/icu-config > icu-config

    • OR

    • wget https://gist.githubusercontent.com/jasny/e91f4e2d386e91e6de5cf581795e9408/raw/16e2c42136eb3f214222c80d492e71942b77f174/icu-config

  • Make the file executable:

    • chmod +x icu-config

  • Move the file to /usr/bin

    • sudo mv icu-config /usr/bin

Now try to rerun phpbrew.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rsantellan picture rsantellan  ·  3Comments

portchris picture portchris  ·  6Comments

luohengyi picture luohengyi  ·  5Comments

escopecz picture escopecz  ·  3Comments

Gamesh picture Gamesh  ·  3Comments