Advanced search  

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

Pages: [1]   Go Down

Author Topic: phpbb3 bridging mysql port  (Read 5895 times)

0 Members and 1 Guest are viewing this topic.

onamission

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
phpbb3 bridging mysql port
« on: November 25, 2010, 11:07:57 pm »

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

Code: [Select]
$dbhost = 'my.host.com';
$dbport = '40000';
$dbname = 'phpbb3';
$dbuser = 'user';
$dbpasswd = '********';
$table_prefix = 'phpbb_';

now my coppermine config looked like

Code: [Select]
$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

Code: [Select]
$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.
Logged

Nibbler

  • Guest
Re: phpbb3 bridging mysql port
« Reply #1 on: November 25, 2010, 11:12:51 pm »

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

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

Add

Code: [Select]
            // 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.
Logged

onamission

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: phpbb3 bridging mysql port
« Reply #2 on: November 26, 2010, 05:34:35 pm »

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)

Code: [Select]
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.
Logged
Pages: [1]   Go Up
 

Page created in 0.042 seconds with 20 queries.