1. 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

Discussion in 'XenForo Questions and Support' started by oman, Feb 16, 2016.

  1. oman

    oman Well-Known Member

    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?
     
  2. Mouth

    Mouth Well-Known Member

    Reads like you've missed a single/double quote around some text in there?
     
  3. oman

    oman Well-Known Member

    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?
     
  4. Mike

    Mike XenForo Developer Staff Member

    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)?
     
  5. oman

    oman Well-Known Member

    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;
     
  6. Mike

    Mike XenForo Developer Staff Member

    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.
     
  7. oman

    oman Well-Known Member

    Ah okay that explains it.

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

    tajhay Well-Known Member

    Yep happens to me as well mate. I think i fixed it by copying and pasting the correct quotes.
     
  9. Brogan

    Brogan XenForo Moderator Staff Member

    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
     
  10. Martok

    Martok Well-Known Member

    If you're using a Mac, then you can use TextWrangler which will do a similar thing to Notepad++ (which is only available on Windows).

    upload_2016-2-16_12-23-25.png
     
    Tracy Perry likes this.
  11. oman

    oman Well-Known Member

    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.
     
  12. Mr Lucky

    Mr Lucky Well-Known Member

    Text Edit is fine, but in preferences, choose plain text and turn off smart quotes.
     
    oman likes this.
  13. Martok

    Martok Well-Known Member

    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.
     
  14. Mr Lucky

    Mr Lucky Well-Known Member

    Is that TextWrangler you are talking about? I'll have to try that. Currently I'm using Diffmerge on mac for file comparison.
     
  15. Martok

    Martok Well-Known Member

    Yes, TextWrangler has this find differences feature. It also has comparison, multi-file search, multiple windows and a host more stuff.
     
    Mouth likes this.
  16. Mr Lucky

    Mr Lucky Well-Known Member

    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.
     
  17. Mouth

    Mouth Well-Known Member

    Martok likes this.
  18. Martok

    Martok Well-Known Member

    Yes it does, as @Mouth has linked to. I also just did a closed file find and replace before I saw his link. :)
     

Share This Page