Why do I get Error: Missing one or more required components of PHP that MediaWiki needs (mbstring)?

Viewed 314

I have mediawiki on my local machine. I have php and php-mbstring installed. When I run phpinfo(), mbstring shows up. I have checked that I have mbstring.ini and mbstring.so, and they are on my machine.

When I run php maintenance/update.php I get this error:

Error: Missing one or more required components of PHP.
You are missing a required extension to PHP that MediaWiki needs.
Please install:
 * mbstring <https://www.php.net/mbstring>

mbstring is installed and enabled, so I am not sure what to do here.


Versions:

  • php CLI: 7.4.5
  • php : 7.3.19-1
  • MediaWiki: 1.34.1
1 Answers

As has been said in the comments, you may have mbstring enabled only for your PHP backend, like php-fpm.

To make sure that mbstring is enabled for php-cli, type php -i | grep 'mbstring' in your console. If there is no output, php-cli has no access to mbstring. Alternatively, you can use phpquery -v 7.4 -s cli -m mbstring.

The best way to enable PHP extensions everywhere is to use sudo phpenmod mbstring. You can also check the existence and contents of /etc/php/7.4/cli/conf.d/20-mbstring.ini (extension=mbstring.so).

If you have build PHP from source for debug, then the location of .ini files may be different.

Related