How to install extensions

SteveMann

New member
What I know about PHP would fit on a postage stamp.
I have a mini-PC running Ubuntu Desktop v24.04.
I installed Apache2.
I installed PHP8.1
I installed MediaWiki.

On the first run of MediaWiki, I get this error:
cKH5Ksbn


In case the image doesn't appear,
MediaWiki 1.39 internal error
Installing some PHP extensions is required.
You are missing a required extension to PHP that MediaWiki requires to run. Please install:
mbstring
intl
I did a sudo apt install of both missing extensions:
Code:
sudo apt install php-intl
sudo apt install php-mbstring
No errors from the install.

But the error remains even after a reboot.

So, what do I have to do to get PHP to recognize the extensions?
 
Verify the version of the php, you can check the location with all modules for current version going to /etc/php/8.1/conf.d/
 
To ensure that PHP recognizes the installed extensions (mbstring and intl), you need to make sure they are enabled in the PHP configuration. Here's what you can do:

1. **Check the extension directory**: Confirm that the required PHP extension files are present in the extension directory. In Ubuntu with PHP 8.1, the extensions should be located in the `/usr/lib/php/20210902` directory. Look for files named `mbstring.so` and `intl.so`.

2. **Enable the extensions**: Open the PHP configuration file (`php.ini`) using a text editor. In Ubuntu, the configuration file is typically located at `/etc/php/8.1/apache2/php.ini`.

Search for the following lines and uncomment them (remove the semicolon at the beginning of each line if present):
```
extension=mbstring
extension=intl
```

Save the changes and close the file.

3. **Restart Apache**: After enabling the extensions, restart the Apache web server to apply the changes. You can do this by running the following command:
```
sudo service apache2 restart
```

This command will restart Apache and reload the PHP configuration.

4. **Verify the extensions**: Once Apache has restarted, verify if the extensions are now recognized by PHP. You can do this by creating a simple PHP file (`info.php`) in your web server's document root directory (usually `/var/www/html/`). Add the following content to the file:
```php
<?php
phpinfo();
?>
```

Save the file and access it through a web browser using the URL `http://localhost/info.php`. Search for the extension names (`mbstring` and `intl`) on the page to confirm if they are enabled and loaded by PHP.

5. **Retry MediaWiki**: After ensuring that the extensions are enabled, try running MediaWiki again. The error message regarding the missing extensions should no longer appear.

By following these steps, you should be able to enable the required extensions (`mbstring` and `intl`) in PHP and resolve the error you encountered when running MediaWiki.
 
Back
Top