Digitalroot-Technologies/MediaWiki_PHPBB_Auth

Assistance Installing

Closed this issue · 4 comments

Hi, I'm trying to install PHPBB_Auth with quite minimal experience and run into an issue.

I've successfully installed PluggableAuth and got that running. I've downloaded and placed the PHPBB_Auth files into an Auth_phpBB directory. I'm just now having issues with actual installation.

I'm getting the following error:
[ZBpt2ZZB1oX3jInaickR7AAAAAw] 2023-03-22 02:54:17: Fatal exception of type "Error"

'PathToPHPBB' => '../phpbb3/', // Path from this file to your phpBB install
'UserTB' => 'phpbb3_users', // Name of your phpBB user table
'GroupsTB' => 'phpbb3_groups', // Name of your phpBB groups table
'User_GroupTB' => 'phpbb3_user_group', // Name of your phpBB user_group table

I'm running on sitegrounds so I've entered the first line as the following:
'PathToPHPBB' => '/public_html/forum',

Is this correct or should I be entering a path for a specific phpbb3 file? If so where is this in a fresh install?

For the tables, I've checked my tables under phpMyAdmin. They're all referred to with "soft_" ("soft_users", "soft_groups", "soft_user_group") so would I just be entering that in? I've noticed that the mediawiki user/user group tables are also called "soft_". Do I need to rename one of them so that it references the phpbb ones or will it automatically path to those from the first line?

Also, is there any way to connect an existing mediawiki user to a new phpbb account?

Thanks in advance for any help with this.

cpeel commented

Hello!

I'm running on sitegrounds so I've entered the first line as the following:
'PathToPHPBB' => '/public_html/forum',

Is this correct or should I be entering a path for a specific phpbb3 file? If so where is this in a fresh install?

The PathToPHPBB should point to the directory where all the phpBB files are located, not a specific file. For instance, the directory should have things like phpbb/, config/, and passwords/ directories in it.

For the tables, I've checked my tables under phpMyAdmin. They're all referred to with "soft_" ("soft_users", "soft_groups", "soft_user_group") so would I just be entering that in?

Yes, those look like the phpBB tables just with soft_ prefixed to them, so use that for UserTB etc.

I've noticed that the mediawiki user/user group tables are also called "soft_". Do I need to rename one of them so that it references the phpbb ones or will it automatically path to those from the first line?

Don't rename anything. At a quick glance it looks like the MW table names are distinct from the phpBB table names even if they have the same prefix, but I would really be surprised if they were all jumbled up into the same database. Are the tables in different databases or the same database? If they are in different databases you'll need to set UseExtDatabase and MySQL_Database. If the login credentials are different for that database, you'll want to set MySQL_Username and MySQL_Password too. If they're all in the same database and both phpBB and MW are working you shouldn't need to change anything.

For additional troubleshooting to see where things are going sideways, enable debugging (see https://github.com/Digitalroot-Technologies/MediaWiki_PHPBB_Auth#troubleshooting).

Also, is there any way to connect an existing mediawiki user to a new phpbb account?

You can use the custom username mapping (as described in the README) to map MediaWiki usernames to the phpBB accounts. The usernames don't have to match. I'd suggest getting the basic configuration working before adding this additional complexity though.

The PathToPHPBB should point to the directory where all the phpBB files are located, not a specific file. For instance, the directory should have things like phpbb/, config/, and passwords/ directories in it.

For easier reference, here's my directory:
directory
And here's how I've pathed it currently, if you could let me know if that's correct:
pathing

Are the tables in different databases or the same database?

I believe they are, yes. Sorry, really extremely new to this, but here are the databases which I'm assuming are the ones you're talking about, both have user tables inside them:
databases

If they are in different databases you'll need to set UseExtDatabase and MySQL_Database. If the login credentials are different for that database, you'll want to set MySQL_Username and MySQL_Password too. If they're all in the same database and both phpBB and MW are working you shouldn't need to change anything.

Here's how the config.php in phpbb looks:
config php

I'm not sure if dbhost and dbport are necessary, so I've put the others in.

pathing for debug

For additional troubleshooting to see where things are going sideways, enable debugging

You can see my debugging option in the above image, but truthfully I'm not sure if I've got that right - I'm not seeing a "mw-debug-Auth_phpBB.log" or any errors in LocalSettings.php appear when I'm getting new errors trying to log in to MW with a phpbb login.

Sorry again for what I'm sure is very simple! If there's somewhere else I should be asking for simpler things like this let me know. First time on github so I'm not sure of the etiquette, but your help is greatly appreciated :)

cpeel commented

Got it. All of that generally looks right. Both of the paths you're setting are using absolute paths that assume the base of your account is at the root of the filesystem. That's not impossible but it's a little suspect to me. Thankfully we can use the MediaWiki $IP value as a workaround.

By the looks of your directory layout, the phpBB directory (ie forum/) has been placed at the root of the MediaWiki installation. So what I would recommend is trying:

'PathToPHPBB'  => $IP . '/forum/',        // Path from this file to your phpBB install

And for debugging:

$wgDebugLogGroups = [
    "Auth_phpBB" => $IP . "/../logs/mw-debug-Auth_phpBB.log",
];

To write files into your logs/ directory a level up from your MW installation.

I'd also recommend moving the debugging stanza to the top of your LocalSettings.php to give that a chance to get picked up before the wfLoadExtension()s.

Finally, you can bring out the big guns for MW debugging with these (also at the top of the file)

$wgShowExceptionDetails = true;
$wgShowDBErrorBacktrace = true;
$wgDebugLogFile = $IP . "/../logs/mw-debug.log";

Let me know how that goes. Hopefully you at least get some debug logs we can use to troubleshoot further.

This was addressed offline. For future reference, in this hosting configuration the phpBB config was underneath the MediaWiki config, eg:

/public_html/          <-- root of the MediaWiki installation
/public_html/forum/    <- root of the phpBB installation

Which means PathToPHPBB needs to be set to forum/. In addition the phpBB table prefix was phpbbiw_ rather than (what I think is the default) phpbb3_.