Skip to:
Content
Pages
Categories
Search
Top
Bottom

config.php

Viewing 18 replies - 1 through 18 (of 18 total)

  • chrishajer
    Participant

    @chrishajer

    Looking through the source for https://trac.bbpress.org/browser/trunk/bb-includes/db-mysqli.php I don’t see the provision for setting a port number (someone correct me if it is actually accounted for somewhere else.)

    MySQL normally operates on port 3306, not 1337, so I don’t know if you are making up that port or if your host actually runs MySQL on that port. If he does run MySQL on that port, then I don’t know what to do.

    If it’s actually port 3306, everything will work fine if you set this in config.php:

    define('BBDB_HOST', 'blabla.bla.pl'); with no http and no colon and no port.

    HTH

    yeah thx for reply but actually im using 3305 unfortunately.. 1337 was only an example.

    so… any idea?


    chrishajer
    Participant

    @chrishajer

    Sorry, I do not. WordPress is like this too with no provision AFAIK for a non-standard port.

    But, I was looking at bb-includes/db.php just now and the mysql_connect function is being used. That function can user dbservername.com:port by default according to this page: http://www.php.net/function.mysql-connect

    So, in theory, this should work:

    define('BBDB_HOST', 'blabla.bla.pl:3305');

    Did you try that and it does not work?

    yes, i tried and doesn’t – i get ‘Cannot select DB.’ . in wordpress it works.


    chrishajer
    Participant

    @chrishajer

    It looks like WordPress uses the same exact syntax for the connection, so, it SHOULD work. Are you certain the string is exactly the same as the one you have in wp-config.php? If it works in WordPress, I think it should work in bbPress.

    yeah it is exactly the same syntax. i would like any moderator to answer.

    it’s really important for me.

    What host are you using? What database version are they setup with? Have you asked them about it because it should find the available port without actually having it defined in your config as long you just define the hostname or try using localhost.

    Trent

    sql.kmr.nazwa.pl:3305 i tried also localhost and host without port defined.

    version of server: 5.0.26-log

    version of mysql: 4.1.11

    http://www.kmr.nazwa.pl – wordpress

    http://www.kmr.nazwa.pl/forum – bbpress.

    What do you have in your wp-config for the host and database name in wordpress?

    Trent

    wordpress:

    define(‘DB_HOST’, ‘sql.kmr.nazwa.pl:3305’);

    define(‘DB_NAME’, ‘kmr’);

    bbpress:

    define(‘BBDB_NAME’, ‘kmr’);

    define(‘BBDB_HOST’, ‘sql.kmr.nazwa.pl:3305’);


    Sam Bauers
    Participant

    @sambauers

    By the looks of things, mysqli_connect doesn’t support the “hostname:port” syntax on remote mysql servers (i.e. other than localhost), but mysql_connect does…

    I’ve reported this as a bug and submitted a patch here:

    https://trac.bbpress.org/ticket/627

    great, how can i install a patch?

    You have download your copy of /bb-includes/db-mysqli.php and then put in the parts in GREEN and take out the parts in RED out of this file:

    https://trac.bbpress.org/attachment/ticket/627/mysqli-connection-port-build788.patch

    Trent

    ok works, but i have 2 warnings:

    Warning: Cannot modify header information – headers already sent by (output started at /home/kmr/ftp/forum/config.php:1) in /home/kmr/ftp/forum/bb-admin/install.php on line 9

    Warning: Cannot modify header information – headers already sent by (output started at /home/kmr/ftp/forum/config.php:1) in /home/kmr/ftp/forum/bb-includes/functions.php on line 1819

    and 3 when i logout in forum:

    Warning: Cannot modify header information – headers already sent by (output started at /home/kmr/ftp/forum/config.php:1) in /home/kmr/ftp/forum/bb-includes/pluggable.php on line 37

    Warning: Cannot modify header information – headers already sent by (output started at /home/kmr/ftp/forum/config.php:1) in /home/kmr/ftp/forum/bb-includes/pluggable.php on line 37

    Warning: Cannot modify header information – headers already sent by (output started at /home/kmr/ftp/forum/config.php:1) in /home/kmr/ftp/forum/bb-includes/pluggable.php on line 166


    chrishajer
    Participant

    @chrishajer

    The error “Warning: Cannot modify header information – headers already sent by” is generally caused by white space before the <?php or after the ?> in a file you edited. Check for that and I think you will find your problem.

    Thanks Sam for submitting that patch :)


    Sam Bauers
    Participant

    @sambauers

    I accidentally left a print_r() command in the first upload of the patch. Check line 64 of db-mysli.php, if it has print_r($server); on it, just remove that line completely.

    print_r() forces output, which may explain the errors. Sorry about that.

    Warning: Cannot modify header information - headers already sent by (output started at /home/kmr/ftp/forum/config.php:1) in /home/kmr/ftp/forum/bb-includes/pluggable.php on line 166

    when i login. i don’t have print_r funciton.

    edit:

    ok, everything seem to be working ok. thank ya ! :)


    esteroizi
    Member

    @esteroizi

    :D 10x for the answer

Viewing 18 replies - 1 through 18 (of 18 total)
  • You must be logged in to reply to this topic.
Skip to toolbar