Cannot install php-intl on php7.2 image

php

#1

I am using this image circleci/php:7.2-apache-stretch-node-browsers (Ubuntu 14.04) and I cannot install the ext-intl extension, which is a requirement for one of my packages. I tried different commands, like

sudo apt-get install php7.0-intl
sudo apt-get install php-intl

And getting errors like the following:

Package php7.2-intl is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'php7.2-intl' has no installation candidate

I went through many posts, one of them being this How to install PHP7 ext-intl?. But I am not sure where to place that --enable-intl in my config. Any help with this is much appreciated! :slight_smile:


#2

That’s only if you are compiling PHP from source. You can do that, but I tend to recommend that people use Apt instead if they can - it’s faster, for a start.

Try running this search (this is what I get):

$ apt-cache search php-intl
php-intl - Internationalisation module for PHP [default]
php7.0-intl - Internationalisation module for PHP

Also try searching for php7-intl as well.


#3

@halfer

Just tried the search. I’m getting…well basically nothing:

image

Is there something I’m missing? :thinking:


#4

Try a regex search:

apt-cache search php.+intl

The .+ means “one or more of any characters”.

If that returns nothing then you’ll need to have some fun compiling PHP :slight_smile:

Update

Or, you can specify a custom Docker image from Docker Hub, if you can find a ready-made one, with the extensions you need, that you believe is trustworthy.


#5

While googling around reading about docker images, I found this comment:

So I added these to my config:

      - run: sudo apt-get update
      - run: sudo apt-get install -y zlib1g-dev libicu-dev g++
      - run: sudo docker-php-ext-configure intl
      - run: sudo docker-php-ext-install intl

So that fixed it! Thanks a lot for the tips! :slight_smile:


#6