WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] PHP Error preventing login, but site loads (partially) (6 posts)

  1. cozbaldwin
    Member
    Posted 1 year ago #

    When trying to access /wp-admin/ in the browser, I'm getting:
    Parse error: syntax error, unexpected $end, expecting T_VARIABLE or T_DOLLAR_OPEN_CURLY_BRACES or T_CURLY_OPEN in /***/wp-admin/includes/media.php on line 1244

    The site loads ok, but the sidebars are missing.
    See: http://www.hiddeninthesand.com/blogs/

    Now, I haven't done much recently to this site, so it must have happened during an upgrade of WP version or plugin. The theme files haven't been touched, although I will say this is an old theme and most likely it's age is the culprit somewhere.

    Here is the last 13 lines of media.php where the error is supposedly happening:

    $extra_rows = array();
    
    		if ( !empty( $field['errors'] ) )
    			foreach ( array_unique( (array) $field['errors'] ) as $error )
    				$extra_rows['error'][] = $error;
    
    		if ( !empty( $field['extra_rows'] ) )
    			foreach ( $field['extra_rows'] as $class => $rows )
    				foreach ( (array) $rows as $html )
    					$extra_rows[$class][] = $html;
    
    		foreach ( $extra_rows as $class => $rows )
    			foreach ( $rows as $html )
    				$item .= "\

    I've already tried changing the directory name of the theme via FTP hoping the site would switch to using twenty-eleven. But all that did was cause the site to not load at all.

    Kinda wondering what else I could do... Any ideas?

  2. CPC Mike
    Member
    Posted 1 year ago #

    Did you edit that file for some reason? Either you did not post the rest of that last line or it was edited out. I suggest replacing media.php with a fresh copy from 3.42 and see if that fixes the issue.

    Also, I highly recommend upgrading to a more current theme.

  3. cozbaldwin
    Member
    Posted 1 year ago #

    I'm definitely gonna go with a new theme.

    But no, I made no edits to that page, which is why I didn't think it necessary to re-upload files.

    But I see now they are vastly different. I updated the file and went deeper down the rabbit hole. The next error reads:
    Parse error: syntax error, unexpected $end in /***/wp-admin/includes/plugin.php on line 467

    Went to look there and found it, too, stopped abruptly on line 467.

    function is_plugin_active_for_network( $plugin ) {
    	if ( !is_multisite() )
    		return false;
    
    	$plugins = get_site_option( 'active_sitewide_plugins');
    	if ( isset($plugins[$plugin]) )
    		ret

    Overwriting that allowed me to get to the login screen, but upon logging in, I was greeted with:
    Fatal error: Class 'WP_Screen' not found in /***/wp-admin/includes/deprecated.php on line 881

    But overwriting that does nothing. That file is up to date and here is line 875-882:

    function add_contextual_help( $screen, $help ) {
    	_deprecated_function( __FUNCTION__, '3.3', 'get_current_screen()->add_help_tab()' );
    
    	if ( is_string( $screen ) )
    		$screen = convert_to_screen( $screen );
    
    	WP_Screen::add_old_compat_help( $screen, $help );
    }

    You can see that WP_Screen does exist there.

  4. CPC Mike
    Member
    Posted 1 year ago #

    I'm really not sure where the problem lies. My best suggestion would be to try a manual reinstallation. You should backup your site and database through your hosting control panel before you attempt this.

    http://codex.wordpress.org/Updating_WordPress#Manual_Update

    Make certain not to delete your wp-content folder. The above instructions are pretty straightforward. Let me know.

  5. cozbaldwin
    Member
    Posted 1 year ago #

    Yeah, i think that's the only way to go now. I'll try that soon and try to remember to document results here. Thanks for your time.

  6. cozbaldwin
    Member
    Posted 1 year ago #

    Well that did it. Must have been a bad/incomplete upgrade when I last did it.
    However my sidebars are not being recognized anymore and that's gotta be a theme thing so I'm SOL until I can get some time to customize a new theme up.

    Thanks again.

Topic Closed

This topic has been closed to new replies.

About this Topic