1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.2 config file error

Discussion in 'Installation, Upgrade, and Import Support' started by Adam Howard, Jun 30, 2013.

  1. Adam Howard

    Adam Howard Well-Known Member

    So before I go reporting this as a bug, I'm just wondering if maybe I'm missing something here.

    This is the config.php file that XenForo automatically generated.

    PHP:
    <?php



    $config
    ['db']['host'] = 'localhost';

    $config['db']['port'] = '3306';

    $config['db']['username'] = 'USER NAME HERE';

    $config['db']['password'] = 'PASSWORD HERE';

    $config['db']['dbname'] = 'DATABASE HERE';





    $config['superAdmins'] = '1';

    I normally add a few small things such as this on top.

    PHP:
    #$config['enableListeners'] = false;
    #$config['debug'] = 1;
    #ini_set('display_errors', true);
    And a condense the white space (as I do with any site in the past). So the end result is


    PHP:
    <?php
    #$config['enableListeners'] = false;
    #$config['debug'] = 1;
    #ini_set('display_errors', true);
    $config['db']['host'] = 'localhost';
    $config['db']['port'] = '3306';
    $config['db']['username'] = 'USER NAME HERE';
    $config['db']['password'] = 'PASSWORD HERE';
    $config['db']['dbname'] = 'DATABASE HERE';
    $config['superAdmins'] = '1';
    This is exactly how I have it on my live site and all is working fine.

    I just did this on my test site which is a fresh copy of XenForo 1.2 ..... Gave me all sorts of issues telling me the config file was wrong.

    Thoughts?
     
  2. Adam Howard

    Adam Howard Well-Known Member

    Parse error: syntax error, unexpected T_VARIABLE in /home/sociall1/sociallyuncensored.net/xenforo/library/config.php on line 1

    That is the error I get when removing the "white space"

    And this is what the config file looks like

    PHP:
    <?php
    $config
    ['db']['host'] = 'localhost';
    $config['db']['port'] = '3306';
    $config['db']['username'] = 'USER NAME HERE';
    $config['db']['password'] = 'PASSWORD HERE';
    $config['db']['dbname'] = 'DATABASE HERE';
    $config['superAdmins'] = '1';
     
  3. Adam Howard

    Adam Howard Well-Known Member

    Parse error: syntax error, unexpected $end in /home/sociall1/sociallyuncensored.net/xenforo/library/config.php on line 1

    When adding this to the above

    PHP:
    #$config['enableListeners'] = false;
    #$config['debug'] = 1;
    #ini_set('display_errors', true);
    This the full config file looks like

    PHP:
    <?php
    #$config['enableListeners'] = false;
    #$config['debug'] = 1;
    #ini_set('display_errors', true);
    $config['db']['host'] = 'localhost';
    $config['db']['port'] = '3306';
    $config['db']['username'] = 'USER NAME HERE';
    $config['db']['password'] = 'PASSWORD HERE';
    $config['db']['dbname'] = 'DATABASE NAME';
    $config['superAdmins'] = '1';
     
  4. Adam Howard

    Adam Howard Well-Known Member

    SOLVED

    This is an odd one. One which has me puzzled and I don't know what is causing it.

    But it's not a XenForo issue.

    I've been using Notepad++ to edit my php files

    @Paul M somewhere is going to preach how bad normal Notepad is and I recall he's the one who told me about Notepad++ It's never failed me before until now.

    Untitled.png


    And what was happening is I'd remove that empty space seen in Notepad++ and it would end up merging the lines together.... Only it wouldn't look like that in Notepad++, but regular Notepad would reveal the truth.


    As I hate Notepad ..... I guess its maybe time to find another editor (something free though).

    But as stated... This not a XenForo issue.
     
  5. RoldanLT

    RoldanLT Well-Known Member

    Sublime 3
     
    Adam Howard likes this.
  6. RoldanLT

    RoldanLT Well-Known Member

    Or maybe update your notepad++, and also maybe not compatible with windows 8
     
    SneakyDave likes this.
  7. Paul M

    Paul M Well-Known Member

    While I would never use Notepad, and would certainly tell you to avoid it, I've never used Notepad++ either.
     
    SneakyDave likes this.
  8. Tracy Perry

    Tracy Perry Well-Known Member

    TextWrangler for the world!
    Of course, it would require you to get a Mac. ;)
     
  9. EasyTarget

    EasyTarget Well-Known Member

    Eclipse IDE. It's the best way I know for editing .php files. Plus a check option and never have the dereaded bom or white space error again.
     
    Adam Howard likes this.
  10. Adam Howard

    Adam Howard Well-Known Member

    Was fairly sure you were the one who told me about Notepad++

    huh.... So what are you using these days @Paul M ?
     
  11. Paul M

    Paul M Well-Known Member

    I use something a friend of mine wrote many years ago called .edit (dot edit).
     
  12. 0xym0r0n

    0xym0r0n Well-Known Member

    Netbeans is good for linux and windows as far as I know.
    I like that and pspad
     

Share This Page