December 2025: MediaWiki backup scripts not running due to wrong PHP CLI version

Summary: Backup scripts written by Sirdog for the wiki fail to run as MediaWiki's script dumpBackup.php reports that PHP modules xml, intl, and mbstring are missing.

Reported by: Sirdog

Date Reported: December 6, 2025

Date Resolved: December 16, 2025 (10 days)

Root Cause: Default PHP version used by the Linux CLI was 8.5. This version did not have the relevant extensions.

Resolution: CLI PHP version switched to 8.3.

Narrative

Sirdog attempted to run his backup script on the MediaWiki installation and observed that it failed to complete. Investigation showed that the script errored when running MediaWiki's dumpBackup.php script, which provided the following output:

PHP Warning:  PHP Startup: Unable to load dynamic library 'intl' (tried: /usr/lib/php/20250925/intl (/usr/lib/php/20250925/intl: cannot open shared object file: No such file or directory), /usr/lib/php/20250925/intl.so (/usr/lib/php/20250925/intl.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'mbstring' (tried: /usr/lib/php/20250925/mbstring (/usr/lib/php/20250925/mbstring: cannot open shared object file: No such file or directory), /usr/lib/php/20250925/mbstring.so (/usr/lib/php/20250925/mbstring.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'xml' (tried: /usr/lib/php/20250925/xml (/usr/lib/php/20250925/xml: cannot open shared object file: No such file or directory), /usr/lib/php/20250925/xml.so (/usr/lib/php/20250925/xml.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

Sirdog requested the assistance of SierraKomodo and Sushiloid to investigate the issue. Sushiloid promised investigation within the hour but then failed to do so. SierraKomodo attempted investigation on December 8 but could not find the root cause, citing that because the chosen web daemon was Caddy rather than Apache that she was unfamiliar with how PHP interacted with Caddy. The one resolution step she attempted was to edit the global PHP ini file to manually enable the 3 modules that script states are missing. This did not resolve the issue.

Sushiloid, after further prompting, agreed to investigate on 12/13. He did not do so. He further agreed to investigate on 12/15 and did not do so.

Sirdog resumed investigation on 12/16. He discovered that the Linux CLI was defaulting to PHP major version 8.5 when MediaWiki was using major version 8.3. Sirdog ran sudo update-alternatives --config php, changed the PHP version to 8.3, and ran his script again. It executed without error.