I'm trying to load the intl PHP extension in my Docker container, but it doesn't seem to work.
Have already tried this https://github.com/docker-library/php/issues/57 but I still get the same error message:
configure: error: in `/usr/src/php/ext/intl': configure: error: C++ preprocessor "/lib/cpp" fails sanity check See `config.log' for more details
My Docker file looks like this:
RUN apt-get -y update \ && apt-get install -y libicu-dev\ && docker-php-ext-configure intl \ && docker-php-ext-install intl
and it's loading from php:fpm
Have anyone gone through this and got to solve the problem? It's getting me nuts.
Docker allows you to set your application with each service running as a microservice. This way, you set a single YML file that will isolate all the services that your application needs to run. The file sets up the PHP Apache server and MySQL database for you.
The Internationalization extension (Intl) is a wrapper for the ICU library, a set of C/C++ and Java libraries that provide Unicode and Globalization support for software applications. It enables PHP programmers to perform UCA-conformant collation and date/time/number/currency formatting in their scripts.
docker-php-ext-install - build extension from source, usually executes docker-php-ext-configure for build configuration, enables the extension (php.ini entry) by executing docker-php-ext-enable after all. docker-php-ext-enable - enables an already extension by adding a specific entry to php. ini.
Your code worked perfectly for me once I added a space before the backslash terminating the second line of the run command:
RUN apt-get -y update \ && apt-get install -y libicu-dev \ ### <-- Added space here && docker-php-ext-configure intl \ && docker-php-ext-install intl
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With