WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [closed] Parse error: syntax error, unexpected end of file, expecting '}' (16 posts)

  1. nathanfield
    Member
    Posted 6 months ago #

    Hello,

    I have recently (after a short hiatus) returned to my website (www.nathanfield.com.au) to find the following message: "Parse error: syntax error, unexpected end of file, expecting '}' in /home/nathanfi/public_html/wp-includes/functions.php on line 3677"

    I have tried to add a '}' to the end of line 3677, however this just gives me the same error message, minus "expecting '}'".

    I am not aware of any change that I made that could cause this! Furthermore, I am not fluent in PHP. Line 3677 is:

    if ( $context && $extra_headers = apply_filters( "extra_{$co

  2. nathanfield
    Member
    Posted 6 months ago #

    Any help is much appreciated!

    Nathan

  3. Gemfruit
    Member
    Posted 6 months ago #

    Post the last 20 or so lines of functions.php for us to see.

  4. nathanfield
    Member
    Posted 6 months ago #

    Hi Gemfruit,

    The last 30 lines are:
    `
    /**
    * Retrieve metadata from a file.
    *
    * Searches for metadata in the first 8kiB of a file, such as a plugin or theme.
    * Each piece of metadata must be on its own line. Fields can not span multiple
    * lines, the value will get cut at the end of the first line.
    *
    * If the file data is not within that first 8kiB, then the author should correct
    * their plugin file and move the data headers to the top.
    *
    * @see http://codex.wordpress.org/File_Header
    *
    * @since 2.9.0
    * @param string $file Path to the file
    * @param array $default_headers List of headers, in the format array('HeaderKey' => 'Header Name')
    * @param string $context If specified adds filter hook "extra_{$context}_headers"
    */
    function get_file_data( $file, $default_headers, $context = '' ) {
    // We don't need to write to the file, so just open for reading.
    $fp = fopen( $file, 'r' );

    // Pull only the first 8kiB of the file in.
    $file_data = fread( $fp, 8192 );

    // PHP will close file handle, but we are good citizens.
    fclose( $fp );

    // Make sure we catch CR-only line endings.
    $file_data = str_replace( "\r", "\n", $file_data );

    if ( $context && $extra_headers = apply_filters( "extra_{$co`

    Thanks!

  5. vtxyzzy
    Member
    Posted 5 months ago #

    Please put the entire file in a pastebin, and post a link to it here.

  6. nathanfield
    Member
    Posted 5 months ago #

    Hi vtxyzzy,

    I've copied the entire file into a pastebin:

    http://pastebin.com/bWCDNJ3Y

    Thanks again for your help!

    Nathan

  7. vtxyzzy
    Member
    Posted 5 months ago #

    There are many, many lines missing from the end of that file. Try uploading a fresh copy from whatever version of WordPress that you are using.

  8. nathanfield
    Member
    Posted 5 months ago #

    Thanks vtxyzzy,

    Because I can't gain access to my WordPress admin panel, how can I find out what version of WordPress I'm running?

    Also, where might I download the file/s?

    Thanks

  9. esmi
    Forum Moderator
    Posted 5 months ago #

    You need to examine the wp-options table in your database and locate the value for the option name db_version.

  10. nathanfield
    Member
    Posted 5 months ago #

    Thanks esmi,

    I couldn't find a file with that db_version line in it telling me explicitly what version I'm in.

    I instead found a file called version.php, which tells me:

    /**
     * The WordPress version string
     *
     * @global string $wp_version
     */
    $wp_version = '3.8';

    Does this sound right?

    Thanks

  11. esmi
    Forum Moderator
    Posted 5 months ago #

    I couldn't find a file with that db_version line in it

    You need to examine the wp-options table in your database.

  12. nathanfield
    Member
    Posted 5 months ago #

    Hi esmi,

    Where/how do I access this database? I searched online and found something called phpMyAdmin, but when I downloaded it, it's just a bunch of php and other files.

    Please excuse my ignorance on how to do these sorts of things!

    Thanks

  13. esmi
    Forum Moderator
    Posted 5 months ago #

    You need to access the database on your hosts' server using their copy of Phpmyadmin or whatever database management tool they provide. If necessary, ask your hoists for assistance.

  14. nathanfield
    Member
    Posted 5 months ago #

    Thanks esmi, vtxyzzy and Gemfruit for your assistance.

    I just logged into CPanel and used Softaculous to update my WordPress version to 3.8.1, and it appears to have fixed the problem.

  15. jmwallace10
    Member
    Posted 2 months ago #

    Help!
    I'm completely locked out, can't even delete and re upload theme, this just keeps popping up.
    Parse error: syntax error, unexpected 'endif' (T_ENDIF) in /home/jmwallace8/public_html/wp-includes/pluggable.php on line 1125

  16. esmi
    Forum Moderator
    Posted 2 months ago #

    If you require assistance then, as per the Forum Welcome, please post your own topic instead of tagging onto someone else's topic.

    I am now closing this 3 month old topic as it references an older version of WordPress.

Topic Closed

This topic has been closed to new replies.

About this Topic