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:
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)://example.com/wp-admin/site-health.php.
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: php7.4-intl 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 http://ppa.launchpad.net/ondrej/php/ubuntu focal/main amd64 php7.4-intl amd64 7.4.27-1+ubuntu20.04.1+deb.sury.org+1 [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 .../php7.4-intl_7.4.27-1+ubuntu20.04.1+deb.sury.org+1_amd64.deb ... Unpacking php7.4-intl (7.4.27-1+ubuntu20.04.1+deb.sury.org+1) ... Setting up php7.4-intl (7.4.27-1+ubuntu20.04.1+deb.sury.org+1) ... Creating config file /etc/php/7.4/mods-available/intl.ini with new version Processing triggers for libapache2-mod-php7.4 (7.4.27-1+ubuntu20.04.1+deb.sury.org+1) ... Processing triggers for php7.4-cli (7.4.27-1+ubuntu20.04.1+deb.sury.org+1) ...
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:
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
[…] ;extension=gmp extension=intl ;extension=imap […]
sudo service apache2 reload
Then I looked in phpinfo.php again; lo and behold, there it was:
This seemed promising; I looked back at the Site Health screen: the error had gone, and WordPress was very happy about it:
References
- https://en.wikipedia.org/wiki/Roy_Walker_(comedian)
- https://www.php.net/manual/en/book.intl.php
- https://make.wordpress.org/hosting/handbook/server-environment/#php-extensions
- https://www.php.net/manual/en/intl.installation.php
- https://phpinfofile.com/
- https://stackoverflow.com/questions/478844/how-do-i-see-the-extensions-loaded-by-php
- https://webrewrite.com/through-command-line-how-i-find-php-ini-file-in-linuxubuntu-and-how-to-edit-it/
- https://pandammonium.org/nobody-panic-but-php-is-missing-the-mysql-extension-which-is-required-by-wordpress/#the-solution