Forums

Parse error - unexpected T_String (10 posts)

  1. JaneC88
    Member
    Posted 1 year ago #

    Have justed installed Version 2.6.3 and had the following error message come up:
    Parse error: parse error, unexpected T_STRING in e:\inetpub\esvc000210\blog\wp-config.php on line 4

    I have removed all " and ' marks as per an earlier post with no success.

    Any ideas?

  2. wpbct7
    Member
    Posted 1 year ago #

    Please post here the code on line 4 and few lines around it.

  3. JaneC88
    Member
    Posted 1 year ago #

    FOURTH LINE OF 1ST PARAGRAPH IN wp-config

    define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value

    OR
    Define (AUTH_KEY ... is the beginning of the fourth line 2nd paragraph:

    // Change each KEY to a different unique phrase. You won't have to remember the phrases later,
    // so make them long and complicated. You can visit http://api.wordpress.org/secret-key/1.1/
    // to get keys generated for you, or just make something up. Each key should have a different phrase.
    define(AUTH_KEY (l\yOgw<=:MIPb7 (i~FK}<CPQt>_0}/F+)QG%GvK8I0fltu=zvI[If,Sk(r\s); // Change this to a unique phrase.
    define(SECURE_AUTH_KEY u!=\ZoPZkYQU@qPr2QFKLE5\\Q|rWTmH1(>R6UDekik8}AIU&ecM./RWsjX$z&#); // Change this to a unique phrase.
    define(LOGGED_IN_KEY u)$p,R_Kh*Hie=R#0z+2NFD\n/\)CHdc-9{N0jbDG|!#=$/FoVp~N46k@@$=); // Change this to a unique phrase.

  4. wpbct7
    Member
    Posted 1 year ago #

    The "define" syntax:

    define(name, value);

    where name is name of the constant (SECURE_AUTH_KEY, LOGGED_IN_KEY, etc.) and value is number or string value, or PHP expression: 1, 'test', 1 + rand(), $another_var, etc.

    So you need to change the code as follows (add comma and quotes around the text):

    define(AUTH_KEY, '(l\yOgw<=:MIPb7 (i~FK}<CPQt>_0}/F+)QG%GvK8I0fltu=zvI[If,Sk(r\s');
    define(SECURE_AUTH_KEY, 'u!=\ZoPZkYQU@qPr2QFKLE5\\Q|rWTmH1(>R6UDekik8}AIU&ecM./RWsjX$z&#');
    define(LOGGED_IN_KEY, 'u)$p,R_Kh*Hie=R#0z+2NFD\n/\)CHdc-9{N0jbDG|!#=$/FoVp~N46k@@$=');

    (but please change the keys so they are public now :-) )

  5. MichaelH
    moderator
    Posted 1 year ago #

    Visiting http://api.wordpress.org/secret-key/1.1/ provides you a set of uniquely generated values you can copy and paste directly into wp-config.php

  6. JaneC88
    Member
    Posted 1 year ago #

    I have tried the generated values from http://api.wordpress.org/secret-key/1.1/ twice with no luck. I have also tried the suggestion from Member wpbct7. Below is the current codes as follows. When I go to re try to install through Explorer it comes back with the error message instantly.

    <?php
    // ** MySQL settings ** //
    define('DB_NAME', "****"); // The name of the database
    define('DB_USER', '****'); // Your MySQL username
    define('DB_PASSWORD', '****'); // ...and password
    define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value
    define('DB_CHARSET', 'utf8');
    define('DB_COLLATE', '');

    // Change each KEY to a different unique phrase. You won't have to remember the phrases later,
    // so make them long and complicated. You can visit http://api.wordpress.org/secret-key/1.1/
    // to get keys generated for you, or just make something up. Each key should have a different phrase.
    define(AUTH_KEY, 'S1khIrv4@0/9rm#ppmx]~Ed1%4]3L8R6pm=A$E!}iC3[CfYh@vl@J<~\\bcsEq~s');
    define(SECURE_AUTH_KEY, '_r9b08x<GP~\'c$_}Gtt=<-{BNS13%\sudPkL:BlSh]SDkcA*2UEMGAxj~\lccw7Bj\');
    define(LOGGED_IN_KEY, 'K]n!^WOQi(tho4[5~\o[34(r?30L?rS_mBLF36bUe!usuu(30#pl]eAcqo2KH?d?F');// 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. */

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

  7. whooami
    Member
    Posted 1 year ago #

    sigh, do this:

    go get a clean wp-config.php

    make those 3 lines look like this:

    define('AUTH_KEY', ''); // Change this to a unique phrase.
    define('SECURE_AUTH_KEY', ''); // Change this to a unique phrase.
    define('LOGGED_IN_KEY', ''); // Change this to a unique phrase.

    all you have done is removed the: put your unique phrase here from each line.

    Notice thats what is left is one pair of single quotes. Your key(s) needs to go inside those single quotes, and should not contain any single or double quotes of it's own.

    I would suggest putting your cursor in the middle of the quotes and just typing randomly, avoiding both quotes keys.

    aka:

    kwelkfmsxpoj54mpoiU)*(&()JI

  8. moshu
    Member
    Posted 1 year ago #

    Hmmm... the problem is that everybody accepted that the 4th line was whatever the OP thought it was, although it is obvious that s/he has no clue about it.
    In the code posted above line #4 is:
    define('DB_USER', '****'); // Your MySQL username
    There is no script that would count lines by paragraphs, as the OP posted!!!

  9. whooami
    Member
    Posted 1 year ago #

    i didnt assume that. her key stuff was wrong though in her original paste, and as thats where she's at now, thats what I answered. :)

  10. wpbct7
    Member
    Posted 1 year ago #

    In PHP string the \ character prevent the ' character from being treated as string end. So the following code is incorrect:

    define(SECURE_AUTH_KEY, '_r9b08x<GP~\'c$_}Gtt=<-{BNS13%\sudPkL:BlSh]SDkcA*2UEMGAxj~\lccw7Bj\');

    You need to remove last \ from the string:

    define(SECURE_AUTH_KEY, '_r9b08x<GP~\'c$_}Gtt=<-{BNS13%\sudPkL:BlSh]SDkcA*2UEMGAxj~\lccw7Bj');

Topic Closed

This topic has been closed to new replies.

About this Topic