Skip to main content
Categories
ErrorsHow To...Plugin

HOW TO: Fix Revslider (Slider Revolution) 500 error on PHP 7+

This is just one way to fix revslider, so let’s first rule out who this doesn’t apply to. If you’re using anything before PHP 7.2, it’s time to update now. Security support for PHP 7.0 ended in December 2018 and while 7.1 support will end in December 2019, it’s no longer being actively updated outside of security patches so updating to PHP 7.2 is a great idea.

If you’ve already made the jump to PHP 7.x and Slider Revolution has been working since at least then, this article probably doesn’t apply to you. But if you’re coming from 5.6 or earlier and are using an older version of Slider Revolution (or revslider) read on.

It’s also worth noting that installing Slider Revolution from scratch on a PHP 7.x environment doesn’t seem to manifest this issue – this is purely for sites migrating or being updated to PHP 7.x environments.

Once your site is on PHP 7.x, you may see a 500 error coming from revslider (in your error logs).

Bare in mind, you may not even be aware it’s active on your site. It’s a super popular plugin and as such comes bundled with a bunch of themes so do be sure to check your active plugin list. Even if it’s active, are you definitely using it to display sliders or banners? If not, we don’t need to fix revslider at all.

Simply renaming the wp-content/plugins/revslider/ directory (to something like wp-content/plugins/definitely-not-revslider/) will disable it and potentially bring your site back up.

In case disabling it is not an option (which is suspect is the case for most of you), the issue will be due to one of 2 errors, or both if you’re lucky.

The Fix #1

The first one is:

PHP Fatal error: Uncaught Error: Call to undefined function mysql_error()

To fix it, with your text editor of choice you’ll need to open either wp-content/plugins/revslider/inc_php/framework/db.class.php or wp-content/plugins/revslider/includes/framework/db.class.php (depending on your version of revslider – only one will be present) and look for this block of code:

// validate for errors
private function checkForErrors($prefix = ""){
     global $wpdb;
     
     if($wpdb->last_error !== ''){
          $query = $wpdb->last_query;
          $message = $wpdb->last_error;

You’ll want to change the if($wpdb->last_error !== ''){ line to if($this—>wpdb->last_error){ (around line 34), so you end up with this:

// validate for errors
private function checkForErrors($prefix = ""){
     global $wpdb;
     
     if($this->wpdb->last_error){
          $query = $wpdb->last_query;
          $message = $wpdb->last_error;

The Fix #2

The second error is:

PHP Fatal error: Uncaught Error: [] operator not supported for strings

To fix this one, you’ll need to open wp-content/plugins/revslider/inc_php/framework/base_admin.class.php, wp-content/plugins/revslider/inc_php/framework/base-admin.class.php or wp-content/plugins/revslider/includes/framework/base-admin.class.php and change private static $arrMetaBoxes = ''; to private static $arrMetaBoxes = array(); (around line 21).

And that should do it!