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

XF 1.5 Test site issue

oman

Well-known member
#1
I ran into an issue when using the guide by Brogan to create a separate test site. Normally it works, but this one threw an error I have not seen before:


Parse error: syntax error, unexpected 'db' (T_STRING) in /home/xxxxx/public_html/url.com/oman1/library/config.php on line 6

I followed each step - copied and imported the database, copied the files over.

Can you suggest what I might have done wrong this time?
 

oman

Well-known member
#3
The format of the password line is as follows:

Code:
$config['db']['password'] = 'PasswordGoesHere';
That is line 6, and it is just the password placed where the old one used to be. Did I miss something in that line?
 

Mike

XenForo developer
Staff member
#4
The error could be before that line or there could actually be an invisible character that got inserted by your editor (I've seen that happen once). What's the whole thing (with sensitive bits replaced)?
 

oman

Well-known member
#5
Code:
<?php

$config['db']['host'] = 'localhost';
$config['db']['port'] = '3306';
$config['db']['username'] = 'blah_username11’;
$config['db']['password'] = 'pwgoeshere';
$config['db']['dbname'] = 'blah_db1234’;


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

//$config['enableListeners'] = 0;
 

Mike

XenForo developer
Staff member
#6
Code:
$config['db']['username'] = 'blah_username11’;
That's a "smart quote" at the end of the line.

It's on the DB name line as well.
 

oman

Well-known member
#7
Code:
$config['db']['username'] = 'blah_username11’;
That's a "smart quote" at the end of the line.

It's on the DB name line as well.
Ah okay that explains it.

I was doing it on the mac textedit program. Is that known to commonly to do that?
 

Brogan

XenForo moderator
Staff member
#9
Notepad++ is great for identifying issues such as this as it will be immediately apparent when viewing the file.

upload_2016-2-16_11-49-57.png
 

oman

Well-known member
#11
Thank you all. I recently started using a Mac, so I hadn't really had a chance to install much other than the default so far.

Notepad ++ was a good one I used in Windows. Thank you @Martok - another one to add to the list to install.
 

Martok

Well-known member
#13
Thank you all. I recently started using a Mac, so I hadn't really had a chance to install much other than the default so far.

Notepad ++ was a good one I used in Windows. Thank you @Martok - another one to add to the list to install.
You can also do code comparison between two files (which you can't with Textedit) which is really useful when editing templates, especially when you have to revert a template and then add back customisations. It can do a myriad of other things too. Well worth installing.
 

Mr Lucky

Well-known member
#14
You can also do code comparison between two files (which you can't with Textedit) which is really useful when editing templates, especially when you have to revert a template and then add back customisations. It can do a myriad of other things too. Well worth installing.
Is that TextWrangler you are talking about? I'll have to try that. Currently I'm using Diffmerge on mac for file comparison.
 

Martok

Well-known member
#15
Is that TextWrangler you are talking about? I'll have to try that. Currently I'm using Diffmerge on mac for file comparison.
Yes, TextWrangler has this find differences feature. It also has comparison, multi-file search, multiple windows and a host more stuff.
 

Mr Lucky

Well-known member
#16
Yes, TextWrangler has this find differences feature. It also has comparison, multi-file search, multiple windows and a host more stuff.
Does it do closed file find and replace (I've been using JeditX for this but seems a bit clunky, although good for other stuff like link checking, html validation and beautifying, not that i do much html these days.
 

Martok

Well-known member
#18
Does it do closed file find and replace (I've been using JeditX for this but seems a bit clunky, although good for other stuff like link checking, html validation and beautifying, not that i do much html these days.
Yes it does, as @Mouth has linked to. I also just did a closed file find and replace before I saw his link. :)