phpbb3 bridging mysql port phpbb3 bridging mysql port
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

phpbb3 bridging mysql port

Started by onamission, November 25, 2010, 11:07:57 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

onamission

i solved this myself but after searching through the forum high and low i never found an answer to this particular problem. so i thought i'd post it here incase someone else came across it or the staff could update the bridge to compensate.

The web service i'm using allows me to use mysql but it runs on a non default port, in this case it was something like 40000. So when i installed phpbb3 it asked me for this port in separate box, in turn it has it's own call in the config.php $dbport or something.

When i installed coppermine i had to use "www.myhost.com:40000" in the database settings. For each install this works fine and i have no problems until i tried to bridge them.

The coppermine bridge would fail with a blank error, basically meaning it could not find the database. Coppermine bridge will not look for the phpbb3 port setting and uses it's own which was  "www.myhost.com:40000" . The problem here is that phpbb3 refuses to read it like that.

so my phpbb3 config file looked like


$dbhost = 'my.host.com';
$dbport = '40000';
$dbname = 'phpbb3';
$dbuser = 'user';
$dbpasswd = '********';
$table_prefix = 'phpbb_';


now my coppermine config looked like


$CONFIG['dbserver'] =                         "my.host.com:40000';        // Your database server
$CONFIG['dbuser'] =                         'user';        // Your mysql username
$CONFIG['dbpass'] =                         '**********';                // Your mysql password
$CONFIG['dbname'] =                         'prefix';        // Your mysql database name


basically if i changed my phpbb3 config to


$dbhost = 'my.host.com:40000';
$dbport = '';


the bridge would work but now my phpbb3 board was failing to connect to the data base. and when i put it back i got the same error. so in the end i did this:

i copied and pasted the phpbb3 config file into a new blank text file, called it config.php and put it somewhere else , like ./dbsettings/config.php on my server. i used the settings in the code box above of "my.host.com:40000" and $dbport = ''; . I then told the bridge to look at this file instead of the normal phpbb3 config.php. This solved my problem and allowed me to bridge the two without error. Maybe you can find a way to make the bridge accomodate for this in future? otherwise my only solution was to use a modified config.php since i couldn't understand how to make you bridge file look for the port used in phpbb3.

Nibbler

Should be able to support this in the bridge file. After


            // Database connection settings
            $this->db = array(
                'name'     => $dbname,
                'host'     => $dbhost ? $dbhost : 'localhost',
                'user'     => $dbuser,
                'password' => $dbpasswd,
                'prefix'   => $table_prefix
            );


Add


            // Add port number if provided
            if (!empty($dbport)) {
                $this->db['host'] .= ':' . $dbport;
            }


Please report back if this works so we can add it in for the next version.

onamission

yes this worked, sorry i had no time to test it before now.

before your edit, if i tried to bridge using correct settings in the wizard i would get this error (where phpbb3 had a specified port for the mysql database)

Coppermine critical error:
Unable to connect to UDB database !

MySQL said:


with your edit to the /bridge/phpbb3.in.php the bridge is successful just as if i was using my custom phpbb3 config.php

so thanks since i'd prefer to do it this way.