0

My PHP 7.2 application is giving the error Message: Class 'NumberFormatter' not found

We are running:

  • PHP 7.2.34
  • CentOS Linux release 7.9.2009 (Core)

I tried to install PHP-intl and it seemed to work as now if I try again I get this:

# yum install php72-php-intl # Package php72-php-intl-7.2.34-4.el7.remi.x86_64 already installed and latest version # Nothing to do 

I have reloaded Apache but the extension is not loaded:

  • php -m does not list the module.
  • /usr/lib64/php/modules does not contain intl.so

By running rpm -ql php72-php-intl I can see these files are installed:

/etc/opt/remi/php72/php.d/20-intl.ini /opt/remi/php72/root/usr/lib64/php/modules/intl.so 

But the extension_dir is set to /usr/lib64/php/modules

Why is it installed to this other location? And how can I either get it to install to the correct modules directory or otherwise what is the correct way to tell PHP to load the .so file from /opt/remi/php72/root/usr/lib64/php/modules ?

1 Answer 1

1

This fixed it:

yum --enablerepo=remi install php-intl 

It installed it to /usr/lib64/php/modules. Also additionally I did not have to add it manually to /etc/php.ini (and doing so caused an error that it is already loaded)

I don't know why --enablerepo=remi is required, or what it means – because yum install php72-php-intl evidently installs it (albeit to the wrong place and not enabled).

My understanding was that if the repo was not enabled it would not be found or installed at all.

3
  • 1
    For a proper installation, follow the wizard instructions: rpms.remirepo.net/wizard Commented May 25, 2021 at 10:18
  • 1
    Also read the FAQ about difference between php-intl and php72-intl: blog.remirepo.net/pages/English-FAQ#scl Commented May 25, 2021 at 10:18
  • Thank you @RemiCollet – this helps a lot. So I previously installed php72-php-intl which was installed beside the default system. Commented Jun 22, 2021 at 18:09

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.