• 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

Adam Howard

Well-known member
#1
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?
 

Adam Howard

Well-known member
#2
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';
 

Adam Howard

Well-known member
#3
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';
 

Adam Howard

Well-known member
#4
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.