WordPress.org

Forums

[resolved] Problem with T_STRING !!!! (9 posts)

  1. ady20
    Member
    Posted 6 years ago #

    hello guys, I wanted to install my own blog(2.15) but can not be set the config.php file.
    I uploaded files, I got my information from the data in wp-config.php, I gave permission to 0777 files. but gives me an error and not know what the cause is:
    Parse error: syntax error, unexpected T_STRING in / home / www / free / XXXX / XXXXXXX / wp-config.php on line 4
    I wrote the name of the database, username, password, I checked a few times, it connects to the database, but it gives me the error and i dont know what would be the case.

    This is the source code of my 4 line:

    mysql select db1("best_video_uv_ro01");

    Do you have any idea? what is rong ?

    Sorry for my bad english.

  2. moshu
    Member
    Posted 6 years ago #

    No, line #4 in the CORRECTLY edited wp-config.php file can NOT be that.
    It is not about source code!
    It is about what you did in the wp-config.php file.

    Review the instructions:
    http://codex.wordpress.org/Installing_WordPress#Step_3:_Set_up_wp-config.php

  3. ady20
    Member
    Posted 6 years ago #

    Well, trust me i have review this intructions for a several time,
    but nothing, the same error.
    This is my config.php file:

    <?php
    // ** MySQL settings ** //
    $dbh = mysql_connect("hostname", "username", "<PASSWORD HERE>") or die ("message");
    mysql select db1("databasename");

    // Change SECRET_KEY to a unique phrase. You won't have to remember it later,
    // so make it long and complicated. You can visit https://www.grc.com/passwords.htm
    // to get a phrase generated for you, or just make something up.
    define('SECRET_KEY', '*******'); // Change this to a unique phrase.

    // You can have multiple installations in one database if you give each a unique prefix
    $table_prefix = 'wp_'; // Only numbers, letters, and underscores please!

    // Change this to localize WordPress. A corresponding MO file for the
    // chosen language must be installed to wp-content/languages.
    // For example, install de.mo to wp-content/languages and set WPLANG to 'de'
    // to enable German language support.
    define ('WPLANG', '');

    /* That's all, stop editing! Happy blogging. */

    define('ABSPATH', dirname(__FILE__).'/');
    require_once(ABSPATH.'wp-settings.php');
    ?>

    I rename the file wp-config-sample.php to wp-config.php.

  4. moshu
    Member
    Posted 6 years ago #

    This is absolutely wrong:

    $dbh = mysql_connect("hostname", "username", "<PASSWORD HERE>") or die ("message");
    mysql select db1("databasename");

    I don't know how did you "review" the instructions and what did you see because it says clearly what to do:

    // ** MySQL settings ** //
    define('DB_NAME', 'putyourdbnamehere');    // The name of the database
    define('DB_USER', 'usernamehere');     // Your MySQL username
    define('DB_PASSWORD', 'yourpasswordhere'); // ...and password
    define('DB_HOST', 'localhost');    //

    Just stop trying to be smarter! Do it exactly as it says:
    Do NOT change anything, just type in your username where it says "usernamehere" etc. - do NOT touch anything else!

  5. ady20
    Member
    Posted 6 years ago #

    Well, now i do exactly as you say,but surpise: Error establishing a database connection. i checked and double checked the config.php,the date are corectly write to this file.
    I forgot to tell somethig:i used a free hosting, could be this a problem ??

  6. moshu
    Member
    Posted 6 years ago #

    // ** MySQL settings ** //
    define('DB_NAME', 'databasename');    // The name of the database
    define('DB_USER', 'username');     // Your MySQL username
    define('DB_PASSWORD', 'PASSWORD'); // ...and password
    define('DB_HOST', 'hostname');    //

    databasename, username, PASSWORD, hostname - are only placeholders.
    But you will have to replace those "placeholders" with the REAL data from your own host!

  7. ady20
    Member
    Posted 6 years ago #

    Of course i have replace whit my real data,but whit no succes.She give the same message :Error establishing a database connection.
    I have cheked,double checked and triple checked my data to be write corectly,but nothing....the same error. i don't know what to do....

  8. moshu
    Member
    Posted 6 years ago #

    Well, despite what you think... in 99.99% of the cases it is a user error: a space, a missing quote ['], wrong quote (when using bad editors) and so on.

  9. ady20
    Member
    Posted 6 years ago #

    Thank's alot for advice , i have resolve the problem.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.