Last modified: 2013-09-30 04:03:26 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T49564, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 47564 - Show a helpful error message if an installer dependency is missing
Show a helpful error message if an installer dependency is missing
Status: NEW
Product: MediaWiki
Classification: Unclassified
Installer (Other open bugs)
1.22.0
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-23 19:07 UTC by Kevin Israel (PleaseStand)
Modified: 2013-09-30 04:03 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Kevin Israel (PleaseStand) 2013-04-23 19:07:27 UTC
(From bug 47356 comment #6)
> It would be nice to have a checker which checks all required
> packages/extensions/functions. This checker should run on installation and on
> the fatal error exception error page.

If a PHP extension such as XML or JSON is missing, the web installer will
fail with a PHP Fatal error even before the current environmental checks
happen. This isn't very user-friendly.

Perhaps the web installer could check for extensions that MediaWiki
unconditionally requires, and show an ugly, non-localized (yet useful)
error page if an extension is missing. Command-line scripts could also
make the same checks.

Perhaps the web installer checks could just run as part of the request
startup or shutdown sequence, even if only when a fatal error or
uncaught exception occurs.

http://stackoverflow.com/questions/277224/how-do-i-catch-a-php-fatal-error
Comment 1 Kevin Israel (PleaseStand) 2013-07-30 14:52:58 UTC
Perhaps XML and JSON aren't very good examples, as work is in progress to
kill those dependencies. However, there are some others:

* Ctype
* Hash (if mcrypt, openssl, /dev/urandom all unusable)
* Session

Ctype might be trivial to implement using strspn or preg_match, though
the others are less trivial.
Comment 2 Nemo 2013-09-10 07:40:06 UTC
In practice, this depends on bug 45822 doesn't it? Or how will the installer know what extensions are needed? Oh, you propose an after the fact solution; so is it alternative to bug 45822?
Comment 3 Kevin Israel (PleaseStand) 2013-09-10 11:20:00 UTC
(In reply to comment #2)
> In practice, this depends on bug 45822 doesn't it? Or how will the installer
> know what extensions are needed? Oh, you propose an after the fact solution;
> so
> is it alternative to bug 45822?

No, this is completely different.

Bug 45822 is for expanding the list of suggested PHP extensions in composer.json, a file used by the Composer[1] dependency manager. This bug is for fixing the MediaWiki installer, which currently uses neither Composer nor its associated configuration files.

[1]: http://getcomposer.org/

Hardcoded checks for certain PHP extensions currently exist in includes/installer/Installer.php. Because certain portions of MediaWiki depend on some of these extensions (and the installer reuses those portions), before the user even gets to select his or her language, a PHP fatal error occurs. If display_errors is off, the user will see not an error message but a blank page.

The most common case occurs when the DOMDocument class, which LocalisationCache::loadPluralFile() uses to load the CLDR plural rules, is missing. This is because Linux distributors such as Red Hat tend to package the DOM extension separately from the PHP binary itself.

The unmerged patch for bug 42205 would add a file containing the same information in PHP serialize() format, which would be readable regardless of the installed set of PHP extensions. This would remove the installer's dependency on the DOM extension. Removing the installer's dependency on the XML extension would be trivial, simply by skipping envCheckBrokenXML when the XML extension is missing.

However, it would still be possible for someone who has compiled PHP himself (e.g. with ./configure --disable-all) to be missing the session extension. It would be nice to show an error message even in those cases.

Apparently, missing ctype_* functions currently aren't a problem, though a check for hash() ought to be added to the installer.
Comment 4 Nemo 2013-09-10 12:07:38 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > In practice, this depends on bug 45822 doesn't it? Or how will the installer
> > know what extensions are needed? Oh, you propose an after the fact solution;
> > so
> > is it alternative to bug 45822?
> 
> No, this is completely different.
> 
> Bug 45822 is for expanding the list of suggested PHP extensions in
> composer.json, a file used by the Composer[1] dependency manager. This bug is
> for fixing the MediaWiki installer, which currently uses neither Composer nor
> its associated configuration files.
> 
> [1]: http://getcomposer.org/

I know it's not currently used, but that bug seems to be asking to expand its usage to fix problems like these. Of course I have no idea what the way forward is. :)

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links