Adding/enabling missing PHP modules in WordPress

On this page:

WordPress has a health check for your site. You can see a summary of the results of the check on your dashboard. This is the results of mine since updating to WordPress 5.9:

Site Health Status for it’s good, but it’s not right

It’s good, to paraphrase the late Roy Walker [1], but it’s not right: there’s one item that needs my attention. Clicking the Site Health screen link takes me to, surprisingly enough, the Site Health screen, which you can go to directly at http(s)://

Site Health Status: an optional module is missing

My health screen shows me that One or more recommended modules are missing, specifically that:

The optional module, intl, is not installed, or has been disabled.

This is an internationalisation module [2], apparently.

I went to my trusty command line, and attempted to use apt install intl to install this missing module. However, I was thwarted:

sudo apt install intlReading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package intl

It seemed I had the name of the package wrong, despite using the name given in the list of optional PHP modules recommended by WordPress [3]. I rummaged around the internet and found an indication of how to install it from the comments on the PHP page for installing the intl package [4]: the module name must be prefixed with PHP and its version number:

sudo apt install php7.4-intlReading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 126 kB of archives.
After this operation, 528 kB of additional disk space will be used.
Get:1 focal/main amd64 php7.4-intl amd64 [126 kB]
Fetched 126 kB in 0s (5,992 kB/s)
Selecting previously unselected package php7.4-intl.
(Reading database ... 158803 files and directories currently installed.)
Preparing to unpack .../ ...
Unpacking php7.4-intl ( ...
Setting up php7.4-intl ( ...

Creating config file /etc/php/7.4/mods-available/intl.ini with new version
Processing triggers for libapache2-mod-php7.4 ( ...
Processing triggers for php7.4-cli ( ...

I expected it to work after that, but I got the same error. I looked in phpinfo.php [5], and it wasn’t there either, although it was listed as being installed [6].

One of the comments on [4] said that I should uncomment out the intl package (by deleting the semi-colon ;) on the appropiate line of php.ini then restart the Apache server:

- open your php.ini file    c:/xampp/php/php.ini or search how to find it, it's up to your server.
- find ;extension=php_intl.dll
- remove the comment ;
- restart apache
- then it's working :)

I used the same when I have problem in any extensions, open php.ini then search for the extension then remove the comment.
Edit php.ini, then restart (reload) Apache (it’s been downvoted, which is why it’s so faint; I found it the most useful piece of information on the whole page)

I found the file [7] and followed the instructions, adapting them for Ubuntu rather than Windows, and reloading Apache, rather than restarting it [8]:

sudo nano /etc/php/7.4/apache2/php.ini
sudo service apache2 reload

Then I looked in phpinfo.php again; lo and behold, there it was:

The phpinfo.php file now shows the PHP intl package

This seemed promising; I looked back at the Site Health screen: the error had gone, and WordPress was very happy about it:

WordPress is happy that there are no warnings/errors to show on the Site Health screen



Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.