2

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
UndoingTech
  • 709
  • 3
  • 16
  • That error message is triggered by a `function_exists( 'mb_substr' )` check. Probably a web server configuration issue, e.g. it's enabled for the web but not CLI. – Tgr Aug 28 '20 at 20:08
  • Thank you @Tgr. This little issue had me very confused and frustrated. I do not know very much about web server configuration, so I do not know how to fix that. For anyone who with the same issue who needs to update, I was able to update from mediawiki by going to `/mw-config`. – UndoingTech Sep 02 '20 at 23:58

1 Answers1

1

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.

Alexander Mashin
  • 3,892
  • 1
  • 9
  • 15