Page MenuHomePhabricator

Installer database driver detection needs rewriting for robustness
Closed, ResolvedPublic

Description

Author: Kagemusha

Description:
I just tried to install MediaWiki 1.10.1 on my kilu.de webspace. the webspace provides PHP5 and MYSQL 5, so MediaWiki should be supported.

The install.doc says to visit the MediaWiki-Url and to fill in the form.
If I go to my MediaWiki (http://gameswiki.kilu.de), it says (logically), that I have to Set up the Wiki first, so I follow the Link but the form does not appear. Instead I get this:

Checking environment...

Please include all of the lines below when reporting installation problems.

  • PHP 5.2.3 installed

the config-directory has chmod 777 and I don't know what to do.


Version: 1.10.x
Severity: enhancement
URL: http://gameswiki.kilu.de/

Details

Reference
bz11013

Related Objects

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:52 PM
bzimport set Reference to bz11013.
bzimport added a subscriber: Unknown Object (MLST).

robchur wrote:

This sounds like a problem occurring with the database driver detection (which happens right after the PHP version is shown to the user).

Assuming you're using MySQL, you might try commenting out lines 289 through 298, and adding the line $ourdb['mysql']['havedriver'] = 1; underneath.

robchur wrote:

Side note: It would be helpful if you could, at some point, run the installer having only commented out line 276, and then send us any errors which appear or which are logged in the Apache or PHP error logs - we get occasional reports of this "halting" issue, but it hasn't happened for us, so debugging it is a bit difficult.

Kagemusha wrote:

first, thanks for the fast response.

I checked both possibilities and with line 276 commented out, I got another error message.
Afterwards I was looking in the board of kilu.de and found out, that the dl() function is disabled.
So I found line 281:
if (extension_loaded($compname) or dl($compname . '.' . PHP_SHLIB_SUFFIX))

and altered it to:
if (extension_loaded($compname))

and the installation was successful. I hope this little change won't affect the wiki negatevily?! ^^

robchur wrote:

r25053 alters things so that dl() isn't called if we can't detect that it's available (testing that the function exists, is callable and isn't disabled according to enable_dl or safe_mode), which should provide more graceful failure in this case.

robchur wrote:

Incomplete patch

Partial patch that begins to clean up most of the detection mess; moves the bulk of detection into separate includes and attempts to reduce a lot of clutter and poor code.

The patch as-is breaks various UI elements; it might be worth reimplementing a lot of the JavaScript bits here; hence I didn't commit it.

Attached:

robchur wrote:

(Incidentally, no, your hack won't have any adverse effects if things are installed fine - the dl() call is just used during installation to attempt to force the database extensions to load.)

Not done with this patch, but the same effect is done with the new-installer being merged in r66008.