• Resolved therembrandt

    (@therembrandt)


    Hi there, i have created a website which was not allowing me to change the login screen dimensions. while trying to edit the problem via the dashboard>appearance>editor method, i deleted some code accidently and now when i try to go to my URL it gives this message:

    Parse error: syntax error, unexpected ‘(‘ in /home/content/n3pnexwpnas02_data02/38/2983638/html/wp-config.php on line 82

    What is this to do with and how would i go about rectifying it? thanks

Viewing 15 replies - 1 through 15 (of 22 total)
  • Hi therembrandt,

    What file were you editing when you got the error?

    Thread Starter therembrandt

    (@therembrandt)

    i was editing the login page function in the themes.php

    Thread Starter therembrandt

    (@therembrandt)

    `// define(‘WP_DEBUG’, true);
    //define( ‘WP_CACHE’, true );
    require_once( dirname )( __FILE__ ) .
    define( ‘FS_METHOD’, ‘direct’);
    define(‘FS_CHMOD_DIR’),
    (0705 & ~ umask()));
    define(‘FS_CHMOD_FILE’), (0604 & ~ umask()));

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

    these are my lines 80 to 88. can you see any obvious issue? im not a coding expert

    Perhaps one too many “)” in each of these:
    […spread them out to see better]

    ( 0705 & ~ umask() ) );
    define('FS_CHMOD_FILE'), ( 0604 & ~ umask() ) );

    Should be:

    ( 0705 & ~ umask() );
    define('FS_CHMOD_FILE'), ( 0604 & ~ umask() );
    Thread Starter therembrandt

    (@therembrandt)

    Thanks for your response,
    just imported that line into the loop but same code error code still occurring.

    I missed this.
    Looked it up in Codex: http://codex.ww.wp.xz.cn/Editing_wp-config.php#Override_of_default_file_permissions

    The original on this link is:

    define( 'FS_CHMOD_DIR', ( 0755 & ~ umask() ) );
    define( 'FS_CHMOD_FILE', ( 0644 & ~ umask() ) );

    So, for yours, instead of:

    define('FS_CHMOD_DIR'),
    (0705 & ~ umask()));
    define('FS_CHMOD_FILE'), (0604 & ~ umask()));

    should it be:

    define( 'FS_CHMOD_DIR', ( 0705 & ~ umask() ) );
    define( 'FS_CHMOD_FILE', ( 0604 & ~ umask() ) );
    Thread Starter therembrandt

    (@therembrandt)

    This is what the page looks like right now after your suggested alterations:

    // define(‘WP_DEBUG’, true);
    //define( ‘WP_CACHE’, true );
    require_once ( dirname ) (__FILE__);
    define( ‘FS_METHOD’ ‘direct’);
    define( ‘FS_CHMOD_DIR’, ( 0705 & ~ umask() ) );
    define( ‘FS_CHMOD_FILE’, ( 0604 & ~ umask() ) );

    The same message is occurring, however instead of “unexpected ‘ ” it is saying “unexpected ‘(‘ ” this is still on line 82

    Thread Starter therembrandt

    (@therembrandt)

    this being line 82

    require_once ( dirname ) (__FILE__);

    Which should read: dirname(__FILE__)
    hence: unexpected ‘(‘

    Thread Starter therembrandt

    (@therembrandt)

    i have implemented this code also and now i am getting the error:

    Parse error: syntax error, unexpected ‘(‘ in /home/content/n3pnexwpnas02_data02/38/2983638/html/wp-config.php on line 84

    these are lines 84 and 85:

    define(‘FS_CHMOD_DIR’) ( 0705 & ~ umask()
    define(‘FS_CHMOD_FILE’, ( 0604 & ~ umask() ) );

    there just seems to be a new problem with each solve. i have tried calling my hosting company and they have said they will try to restore my database to its previous state a few days ago.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    @therembrandt, Please change your SALT keys as soon as you can and take care not to post sensitive data.

    You didn’t copy/paste correctly.

    This:
    define(‘FS_CHMOD_DIR’) ( 0705 & ~ umask()

    Should be this:
    define( 'FS_CHMOD_DIR', ( 0705 & ~ umask() ) );

    This is fine:
    define('FS_CHMOD_FILE', ( 0604 & ~ umask() ) );

    Look at my post above with the codes in it.

    Thread Starter therembrandt

    (@therembrandt)

    Ok, i just pasted it like this with your suggested code structure:

    // define(‘WP_DEBUG’, false);
    //define( ‘WP_CACHE’, true );
    require_once dirname (__FILE__);
    define( ‘FS_METHOD’);
    define( ‘FS_CHMOD_DIR’, ( 0705 & ~ umask() ) );
    define(‘FS_CHMOD_FILE’, ( 0604 & ~ umask() ) );

    and am given this new message when trying to load the site:

    Warning: require_once(/home/content/n3pnexwpnas02_data02/38/2983638/html): failed to open stream: Success in /home/content/n3pnexwpnas02_data02/38/2983638/html/wp-config.php on line 82

    Fatal error: require_once(): Failed opening required ‘/home/content/n3pnexwpnas02_data02/38/2983638/html’ (include_path=’.:/usr/local/php5_4/lib/php’) in /home/content/n3pnexwpnas02_data02/38/2983638/html/wp-config.php on line 82

    Thread Starter therembrandt

    (@therembrandt)

    // define('WP_DEBUG', false);
    //define( 'WP_CACHE', true );
      require_once dirname (__FILE__);
      define( 'FS_METHOD');
      define( 'FS_CHMOD_DIR', ( 0705 & ~ umask() ) );
      define('FS_CHMOD_FILE', ( 0604 & ~ umask() ) );

    Please remember, never post any vital info on forums, even if someone asks for it to assist you.

    Let’s go back to square one here…

    First… do you have a copy of your original wp-config.php on your computer from when you installed the site on your host?
    If so…
    1 – open that wp-config.php file and make sure all the basic necessary info is correct – db_name, db_user, db_password, etc.
    2 – access your site via your file manager or by FTP
    3 – download the current problem wp-config to your computer
    4 – upload your original wp-config.php to your site to replace the problem one
    4 – your site should be back to working order

    To the problem…
    You posted:
    i have created a website which was not allowing me to change the login screen dimensions. while trying to edit the problem via the dashboard>appearance>editor method, i deleted some code accidently and now when i try to go to my URL it gives this message:

    while trying to edit the problem via the dashboard>appearance>editor method

    Which file were you editing?

Viewing 15 replies - 1 through 15 (of 22 total)

The topic ‘Line Error/ Parse Error’ is closed to new replies.