• After updating from the previous version to 4.7 We get the fatal error as below. It is running on windows and use PHP 7

    Fatal error: Uncaught Error: Call to undefined function is_wp_error() in \wp-includes\load.php:434 Stack trace: #0 \wp-settings.php(111): wp_set_wpdb_vars() #1 \wp-config.php(98): require_once(‘\wwwr…’) #2 \wp-load.php(39): require_once(‘D:\\inetpub\\wwwr…’) #3 \wp-blog-header.php(13): require_once(‘\wwwr…’) #4 \index.php(17): require(‘\wwwr…’) #5 {main} thrown in \wp-includes\load.php on line 434

    We have this error on all websites. Any idea what this could be?

    • This topic was modified 7 years, 4 months ago by smurf2011.
Viewing 15 replies - 1 through 15 (of 16 total)
  • Moderator Marius L. J.

    (@clorith)

    Hi,

    This sounds like you have an incomplete update (perhaps a permissions issue, I know that file permissions on Windows hosts can be a nightmare at times). I would attempt a manual update on the site that is failing and see if that sorts it out for you.

    Thread Starter smurf2011

    (@smurf2011)

    This was already a manual update. I have downloaded the https://downloads.wordpress.org/release/nl_NL/wordpress-4.7.zip version.

    Moderator Marius L. J.

    (@clorith)

    Just to be on the safe side, would you mind getting the English release of WordPress from https://wordpress.org/latest.zip and using it for the manual update?

    The language files are handled individually, so you shouldn’t need to get an individual copy like the one used above, and I’d like to test this as it has happened before that individual language specific ones have not been perfect 🙂

    Thread Starter smurf2011

    (@smurf2011)

    Is also not working 🙁

    I have now the following error:
    Fatal error: Cannot redeclare is_wp_error() (previously declared in \wp-includes\load.php:1065) in \wp-includes\class-wp-error.php on line 218

    Thread Starter smurf2011

    (@smurf2011)

    We have found out that WordPress wouldn’t work with PHP7. When we downgrade to PHP5.6 it works without any problem….

    A very bad thing! 🙁

    Moderator Marius L. J.

    (@clorith)

    Hi,

    WordPress is tested against PHP7, and should work just fine. What is more likely here is that your theme, or one of the plugins you use, isn’t compatible with PHP7.

    Deactivating all plugins (yes, all) to see if this resolves the problem. If this works, re-activate the plugins one by one until you find the problematic plugin(s). If you can’t get into your admin dashboard, try resetting the plugins folder by SFTP/FTP or PhpMyAdmin (read “How to deactivate all plugins when you can’t log in to wp-admin” if you need help). Sometimes, an apparently inactive plugin can still cause problems. Also remember to deactivate any plugins in the mu-plugins folder. The easiest way is to rename that folder to mu-plugins-old

    Thread Starter smurf2011

    (@smurf2011)

    Yeah that’s nice. Give the template or plugins debt. But all websites were before the update to 4.7 running on PHP7 without any problems. And after the update no longer.
    And also some websites use the default template twenty twelve and no additional plugins. And this doesn’t work also.

    If you’re going to update with PHP5.6 and after the update back to PHP7 works at some sites. So there is something on 4.7 what isn’t compatible whit PHP7. And this isn’t the first time this happens 🙁

    Moderator Marius L. J.

    (@clorith)

    There’s no known compatibility issues with PHP7 (as a matter of fact, we recommend the use of PHP7).

    Do you have any caching set up, either cache plugins or server level caches, that may be causing headaches as they’ve not been cleared out after the update?

    Thread Starter smurf2011

    (@smurf2011)

    For test I have installed a fresh installation. With no additional plugins and no caching. And it still is not working on PHP7. When I change I it to PHP5.6 it is working perfect. And when I change it back after the update to PHP7 the website is working without any problems. So something code what is used for the update is not working correctly with PHP7.

    But this is not working for all sites. Some sites won’t work anymore on PHP7 after the update. The strange thing is that they work before the update without any problems on PHP7.

    Moderator Marius L. J.

    (@clorith)

    Are they all getting the same error from your original post about a missing function?

    Thread Starter smurf2011

    (@smurf2011)

    The same site give every time the same error. But each site give another error. But this is maybe possible that it are different templates.

    Moderator Marius L. J.

    (@clorith)

    Well, have a look at the end of the load.php file the error references, is_wp_error() should be declared there, is it ?

    Thread Starter smurf2011

    (@smurf2011)

    Sorry, I don’t know exactly what you mean. On the load.php I have the following code where is_wp_error is defined.

    function wp_set_wpdb_vars() {
    	global $wpdb, $table_prefix;
    	if ( !empty( $wpdb->error ) )
    		dead_db();
    
    	$wpdb->field_types = array( 'post_author' => '%d', 'post_parent' => '%d', 'menu_order' => '%d', 'term_id' => '%d', 'term_group' => '%d', 'term_taxonomy_id' => '%d',
    		'parent' => '%d', 'count' => '%d','object_id' => '%d', 'term_order' => '%d', 'ID' => '%d', 'comment_ID' => '%d', 'comment_post_ID' => '%d', 'comment_parent' => '%d',
    		'user_id' => '%d', 'link_id' => '%d', 'link_owner' => '%d', 'link_rating' => '%d', 'option_id' => '%d', 'blog_id' => '%d', 'meta_id' => '%d', 'post_id' => '%d',
    		'user_status' => '%d', 'umeta_id' => '%d', 'comment_karma' => '%d', 'comment_count' => '%d',
    		// multisite:
    		'active' => '%d', 'cat_id' => '%d', 'deleted' => '%d', 'lang_id' => '%d', 'mature' => '%d', 'public' => '%d', 'site_id' => '%d', 'spam' => '%d',
    	);
    
    	$prefix = $wpdb->set_prefix( $table_prefix );
    
    	if ( is_wp_error( $prefix ) ) {
    		wp_load_translations_early();
    		wp_die(
    			/* translators: 1: $table_prefix 2: wp-config.php */
    			sprintf( __( '<strong>ERROR</strong>: %1$s in %2$s can only contain numbers, letters, and underscores.' ),
    				'<code>$table_prefix</code>',
    				'<code>wp-config.php</code>'
    			)
    		);
    	}
    }
    Moderator Marius L. J.

    (@clorith)

    At the very bottom of the file, do you see function is_wp_error( written (it should be the 3rd line from the bottom or so)

    Thread Starter smurf2011

    (@smurf2011)

    You mean this.

    /**
     * Check whether variable is a WordPress Error.
     *
     * Returns true if $thing is an object of the WP_Error class.
     *
     * @since 2.1.0
     *
     * @param mixed $thing Check if unknown variable is a WP_Error object.
     * @return bool True, if WP_Error. False, if not WP_Error.
     */
    function is_wp_error( $thing ) {
    	return ( $thing instanceof WP_Error );
    }
Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Fatal errror after updating to 4.7’ is closed to new replies.