WordPress.org

Forums

Parse error: syntax error (10 posts)

  1. claudiou
    Member
    Posted 2 years ago #

    I found out today this error on my site:

    Parse error: syntax error, unexpected T_STRING in D:\Hosting\8195331\html\wp-config.php on line 17

    This is what I have on the wp-config file on the 17th line:

    define('DB_NAME', 'ska1231712203120');

    Please help me!!

  2. jonradio
    Member
    Posted 2 years ago #

    Be sure to blank out any passwords, but you will need to display the previous several lines, too, as it could be something as simple as a missing semi-colon or comment operator on the previous line(s).

    And please use the backticks (just right of the number 1 on most keyboards) to surround those lines of code.

  3. claudiou
    Member
    Posted 2 years ago #

    These are the lines surrounding the error
    The error is in line 17 which is:

    define('DB_NAME', 'ska1231712203120');

    * @package WordPress
    */
    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define('DB_NAME', 'ska1231712203120');
    /** MySQL database username */
    define('DB_USER', 'ska1231712203120');
    /** MySQL database password */
    define('DB_PASSWORD', '*****************');
    /** MySQL hostname */
    define('DB_HOST', 'ska1231712203120.db.8195331.hostedresource.com');
    /** Database Charset to use in creating database tables. */
    define('DB_CHARSET', 'utf8');
    /** The Database Collate type. Don't change this if in doubt. */
    define('DB_COLLATE', '');
  4. jonradio
    Member
    Posted 2 years ago #

    Thank you. I just took a look at a fresh download of WordPress Version 3.5, which you list was what you are using. That line you quote is Line 19 in the official copy, which leads me to believe that something is missing in your wp-config.php file.

    Here are the official first 19 lines:

    <?php
    /**
     * The base configurations of the WordPress.
     *
     * This file has the following configurations: MySQL settings, Table Prefix,
     * Secret Keys, WordPress Language, and ABSPATH. You can find more information
     * by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
     * wp-config.php} Codex page. You can get the MySQL settings from your web host.
     *
     * This file is used by the wp-config.php creation script during the
     * installation. You don't have to use the web site, you can just copy this file
     * to "wp-config.php" and fill in the values.
     *
     * @package WordPress
     */
    
    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define('DB_NAME', 'database_name_here');
  5. claudiou
    Member
    Posted 2 years ago #

    I just don't see anything different.

    Here's the story behind this.

    A new client of mine had already a site hosed in Godaddy. I took over and decided to go for WordPress, right away I started having issues with godaddy, page too slow to load, lost my FTP access and no FTP File manager either.

    There was nothing I could do, the guys at support were totally useless, always came back with different and random replies but always blaming that the error was on my side.

    I couldn't touched the site in almost 3 weeks, there was nothing I could do with no access to anything.

    Then one day I received an email from godaddy saying there was a WP update, so I updated WP I mean what could happen, well 2 days later this new syntax error appeared and clearly Its something on godaddy's side cause I haven't touched the site in 4 weeks now.

    As normal, the godaddy guys are just pathetic and worthless and so Im looking for a solution on my own.

    That's why I mentioned that the WP version is 3.5 cause in theory Godaddy did the update, but now im just not too sure, dont know what to do!

    Here's what I have on my wp-config.php from line 1 to 27

    <?php/**
    * The base configurations of the WordPress.
    *
    * This file has the following configurations: MySQL settings, Table Prefix,
    * Secret Keys, WordPress Language, and ABSPATH. You can find more information
    * by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
    * wp-config.php} Codex page. You can get the MySQL settings from your web host.
    *
    * This file is used by the wp-config.php creation script during the
    * installation. You don't have to use the web site, you can just copy this file
    * to "wp-config.php" and fill in the values.
    *
    * @package WordPress
    */
    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    
    [ Redacted. Please do not post that info here it's dangerous. ]
    
    /** Database Charset to use in creating database tables. */
    define('DB_CHARSET', 'utf8');
    /** The Database Collate type. Don't change this if in doubt. */
    define('DB_COLLATE', '');
  6. jonradio
    Member
    Posted 2 years ago #

    I just re-created your error on my test system.
    <?php/** is what is creating the error.

    There must be a line break after <?php

  7. Guys? Do not post db user ID, host information, etc. on these forums. It's just not a safe thing to do. Ever.

    Parse error: syntax error, unexpected T_STRING in D:\Hosting\8195331\html\wp-config.php on line 17

    Okay. That's probably fixable.

    but you will need to display the previous several lines, too, as it could be something as simple as a missing semi-colon or comment operator on the previous line(s).

    Nope, don't do that. Really jonradio, please do not ask people to do that. They leave out the part where you say "Be sure to blank out any passwords" and that does cause grief.

    Try this solution instead:

    1. Make a copy of D:\Hosting\8195331\html\wp-config.php and save that somewhere safe.
    2. Rename D:\Hosting\8195331\html\wp-config.php to D:\Hosting\8195331\html\wp-config-SAVE.php
    3. Copy wp-config-sample.php on top of D:\Hosting\8195331\html\wp-config.php (you did make a backup copy right?)
    4. Edit the new D:\Hosting\8195331\html\wp-config.php and put in your specific details from the copy you made. Use notepad and only touch the lines below.
    /** The name of the database for WordPress */
    define('DB_NAME', 'YOUR-DB-NAME-HERE');
    /** MySQL database username */
    define('DB_USER', 'YOUR-DB-USER_ID');
    /** MySQL database password */
    define('DB_PASSWORD', 'YOU-GET-THE-IDEA');
    /** MySQL hostname */
    define('DB_HOST', 'YOUR-DB-HOST');

    Save that file and see if that takes care of your problem. If something goes horribly wrong then restore the copy you made.

  8. jonradio
    Member
    Posted 2 years ago #

    Sorry, Jan. I only every think about passwords being an issue, but I see your points.

    Anyway, the error in this case is the lack of a line break after <?php but Jan's idea is a better one, in case there is another syntax error that I missed.

  9. Sorry, Jan. I only every think about passwords being an issue, but I see your points.

    We're good, I know you meant well. ;)

  10. claudiou
    Member
    Posted 2 years ago #

    Guys, Im not an expert on WP, im still learning.

    I've followed your suggestions and the error is fixed, now is time to leave godaddy for good, im migrating the site to another hosting.

    Please, never use godaddy!

    Thanks very much guys!

Topic Closed

This topic has been closed to new replies.

About this Topic