Title: Fatal error when activating
Last modified: April 26, 2020

---

# Fatal error when activating

 *  Resolved [ImmoF](https://wordpress.org/support/users/immof/)
 * (@immof)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-when-activating-60/)
 * When installing and activating directly from wordpress I immediately get the 
   following, and must rename the plugin from ftp to get anything working on my 
   site.
 * Wordpress is running the lastest version (5.4 en_CA), I have the following plugins
   installed, all at the latest version:
    Additional Variation Images Gallery for
   WooCommerce (tried de-activating) Variation Swatches for WooCommerce (tried de-
   activating) Jetpack by WordPress.com WooCommerce WooCommerce Services
 * Theme: Storefront
 * Fatal error: Uncaught Error: Class ‘MT2MBA_UTILITY_GENERAL’ not found in /(location)/
   wp-content/plugins/markup-by-attribute-for-woocommerce/markup-by-attribute-for-
   woocommerce.php:86 Stack trace: #0 /(location)/wp-includes/class-wp-hook.php(
   287): mt2mba_main(”) #1 /(location)/wp-includes/class-wp-hook.php(311): WP_Hook-
   >apply_filters(NULL, Array) #2 /(location)/wp-includes/plugin.php(478): WP_Hook-
   >do_action(Array) #3 /(location)/wp-content/plugins/woocommerce/includes/class-
   woocommerce.php(569): do_action(‘woocommerce_ini…’) #4 /(location)/wp-includes/
   class-wp-hook.php(287): WooCommerce->init(”) #5 /(location)/wp-includes/class-
   wp-hook.php(311): WP_Hook->apply_filters(NULL, Array) #6 /ho in /(location)/wp-
   content/plugins/markup-by-attribute-for-woocommerce/markup-by-attribute-for-woocommerce.
   php on line 86
    There has been a critical error on your website. Please check
   your site admin email inbox for instructions.

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [Mark Tomlinson](https://wordpress.org/support/users/marktomlinson/)
 * (@marktomlinson)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-when-activating-60/#post-12734273)
 * I’m trying to recreate the error with the same configuration you mention above.
   I’m able to recreate it by renaming either the …/src folder in the plugin directory,
   or renaming …/src/utility/general.php.
 * However, it looks like a portion of your error message is missing. From “#6″,
   you should see something like
 * > #6 /(location)/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
   >  #7 /(
   > location)/wp-settings.php(540): do_action(‘init’) #8 /(location)/wp-config.
   > php(90): require_once(‘/ho(location)…’) #9 /(location)/wp-load.php(37): require_once(‘/
   > ho in /(location)/wp-content/plugins/markup-by-attribute-for-woocommerce/markup-
   > by-attribute-for-woocommerce.php on line 86
 * If that is the case, it sounds like the plugin did not install properly, and
   `/(
   location)/wp-content/plugins/markup-by-attribute-for-woocommerce/src/utility/
   general.php` is missing.
 * You can try reinstalling it, but have FTP handy. If it fails again, ensure there
   is a
    `/(location)/wp-content/plugins/markup-by-attribute-for-woocommerce/src/
   utility/general.php` file. I’d really appreciate it if you could let me know 
   whether it’s there or not.
 * Meanwhile, I’ll look to add some code so the plugin fails more gracefully and
   doesn’t bring the whole site down.
    -  This reply was modified 6 years, 1 month ago by [Mark Tomlinson](https://wordpress.org/support/users/marktomlinson/).
 *  Thread Starter [ImmoF](https://wordpress.org/support/users/immof/)
 * (@immof)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-when-activating-60/#post-12737284)
 * This is the complete error.
 *     ```
       Fatal error: Uncaught Error: Class 'MT2MBA_UTILITY_GENERAL' not found in /homepages/4/d617310271/htdocs/clickandbuilds/ArtisanQuebec/wp-content/plugins/markup-by-attribute-for-woocommerce-master/markup-by-attribute-for-woocommerce.php:87 Stack trace: #0 /homepages/4/d617310271/htdocs/clickandbuilds/ArtisanQuebec/wp-includes/class-wp-hook.php(287): mt2mba_main('') #1 /homepages/4/d617310271/htdocs/clickandbuilds/ArtisanQuebec/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array) #2 /homepages/4/d617310271/htdocs/clickandbuilds/ArtisanQuebec/wp-includes/plugin.php(478): WP_Hook->do_action(Array) #3 /homepages/4/d617310271/htdocs/clickandbuilds/ArtisanQuebec/wp-content/plugins/woocommerce/includes/class-woocommerce.php(569): do_action('woocommerce_ini...') #4 /homepages/4/d617310271/htdocs/clickandbuilds/ArtisanQuebec/wp-includes/class-wp-hook.php(287): WooCommerce->init('') #5 /homepages/4/d617310271/htdocs/clickandbuilds/ArtisanQuebec/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array) in /homepages/4/d617310271/htdocs/clickandbuilds/ArtisanQuebec/wp-content/plugins/markup-by-attribute-for-woocommerce-master/markup-by-attribute-for-woocommerce.php on line 87
       There has been a critical error on your website. Please check your site admin email inbox for instructions.
   
       Learn more about debugging in WordPress.
       ```
   
 * src/utility/general.php is there, filesize 10,213
 * I am running PHP 7.3.16
    MySQL 5.5.60-0+deb7u1-log (the default installed by 
   my server) I have updated my WordPress memory limit to 64 (was 40) I have not
   yet installed my ssl certificate and am not running over https.
 * I get exactly the same error when I manually install version 3.8 from GitHub 
   and activate it, or when I install 3.8 and update to 3.9 and install.
 * Here are the screenshots:
    [https://ibb.co/kHPmpzq](https://ibb.co/kHPmpzq) [https://ibb.co/FsVfz0L](https://ibb.co/FsVfz0L)
 * I could try getting a debug log – I’m an amateur and have only limited programming
   knowledge.
 *  Thread Starter [ImmoF](https://wordpress.org/support/users/immof/)
 * (@immof)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-when-activating-60/#post-12737745)
 * OK, Here is the debug log:
 *     ```
       [27-Apr-2020 12:30:49 UTC] PHP Fatal error:  Uncaught Error: Class 'MT2MBA_UTILITY_GENERAL' not found in /(location)/wp-content/plugins/markup-by-attribute-for-woocommerce/markup-by-attribute-for-woocommerce.php:86
       Stack trace:
       #0 /(location)/wp-includes/class-wp-hook.php(287): mt2mba_main('')
       #1 /(location)/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)
       #2 /(location)/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
       #3 /(location)/wp-content/plugins/woocommerce/includes/class-woocommerce.php(569): do_action('woocommerce_ini...')
       #4 /(location)/wp-includes/class-wp-hook.php(287): WooCommerce->init('')
       #5 /(location)/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)
       #6 /ho in /(location)/wp-content/plugins/markup-by-attribute-for-woocommerce/markup-by-attribute-for-woocommerce.php on line 86
       [27-Apr-2020 12:30:57 UTC] PHP Fatal error:  Uncaught Error: Class 'MT2MBA_UTILITY_GENERAL' not found in /(location)/wp-content/plugins/markup-by-attribute-for-woocommerce/markup-by-attribute-for-woocommerce.php:86
       Stack trace:
       #0 /(location)/wp-includes/class-wp-hook.php(287): mt2mba_main('')
       #1 /(location)/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)
       #2 /(location)/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
       #3 /(location)/wp-content/plugins/woocommerce/includes/class-woocommerce.php(569): do_action('woocommerce_ini...')
       #4 /(location)/wp-includes/class-wp-hook.php(287): WooCommerce->init('')
       #5 /(location)/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)
       #6 /ho in /(location)/wp-content/plugins/markup-by-attribute-for-woocommerce/markup-by-attribute-for-woocommerce.php on line 86
       [27-Apr-2020 12:32:06 UTC] PHP Fatal error:  Uncaught Error: Class 'MT2MBA_UTILITY_GENERAL' not found in /(location)/wp-content/plugins/markup-by-attribute-for-woocommerce/markup-by-attribute-for-woocommerce.php:86
       Stack trace:
       #0 /(location)/wp-includes/class-wp-hook.php(287): mt2mba_main('')
       #1 /(location)/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)
       #2 /(location)/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
       #3 /(location)/wp-content/plugins/woocommerce/includes/class-woocommerce.php(569): do_action('woocommerce_ini...')
       #4 /(location)/wp-includes/class-wp-hook.php(287): WooCommerce->init('')
       #5 /(location)/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)
       #6 /ho in /(location)/wp-content/plugins/markup-by-attribute-for-woocommerce/markup-by-attribute-for-woocommerce.php on line 86
       ```
   
 *  Plugin Author [Mark Tomlinson](https://wordpress.org/support/users/marktomlinson/)
 * (@marktomlinson)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-when-activating-60/#post-12739087)
 * Found it.
 * Your screenshots revealed to me that there is mixed case in your path name, which
   lead me to look at how the class path names are parsed. Lo and behold, I’m putting
   the full path name in lowercase.
 * I’m going to push out an emergency fix later today or tomorrow, after I get done
   with some thorough testing and source management. But if you need a fix right
   now, I can tell you what to do.
 * To fix this,
    1. You’ll need to download Markup by Attribute, but do not activate it.
    2. Through either the Plugin Editor or FTP, locate and edit …/wp-content/plugins/
       markup-by-attribute-for-woocommerce/**autoload.php**.
    3. Replace lines 31 through 45
        (`public static function autoload( $class ) { ...}`)
       with the following
    4.     ```
              public static function autoload( $class )
               {
                   if ( 0 !== strpos( $class, MT2MBA_PLUGIN_PREFIX ) )
                   {
                       return;
                   }
                   else
                   {
                       if ( is_file( $file = dirname( __FILE__ ) . str_replace( '_', '/', strtolower( str_ireplace( MT2MBA_PLUGIN_PREFIX, '/src', $class ) ) . '.php' ) ) )
                       {
                           require_once $file;
                           $class::init();
                       }
                   }
                   return;
               }
           ```
       
    5. Save the code.
    6. Activate the plugin.
 * Let me know if that works. And thank you for your assistance; many people would
   just give up and find a different plugin.
    -  This reply was modified 6 years, 1 month ago by [Mark Tomlinson](https://wordpress.org/support/users/marktomlinson/).
    -  This reply was modified 6 years, 1 month ago by [Mark Tomlinson](https://wordpress.org/support/users/marktomlinson/).
      Reason: Fixed formatting
    -  This reply was modified 6 years, 1 month ago by [Mark Tomlinson](https://wordpress.org/support/users/marktomlinson/).
 *  Thread Starter [ImmoF](https://wordpress.org/support/users/immof/)
 * (@immof)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-when-activating-60/#post-12739615)
 * Great! That works – I will be sending you some chocolates (or coffee) for this
   great plugin and your support.
 *  Plugin Author [Mark Tomlinson](https://wordpress.org/support/users/marktomlinson/)
 * (@marktomlinson)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-when-activating-60/#post-12741374)
 * Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Fatal error when activating’ is closed to new replies.

 * ![](https://ps.w.org/markup-by-attribute-for-woocommerce/assets/icon-256x256.
   png?rev=2952499)
 * [Markup by Attribute for WooCommerce](https://wordpress.org/plugins/markup-by-attribute-for-woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/markup-by-attribute-for-woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/markup-by-attribute-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/markup-by-attribute-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/markup-by-attribute-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/markup-by-attribute-for-woocommerce/reviews/)

## Tags

 * [fatal error](https://wordpress.org/support/topic-tag/fatal-error/)

 * 6 replies
 * 2 participants
 * Last reply from: [Mark Tomlinson](https://wordpress.org/support/users/marktomlinson/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-when-activating-60/#post-12741374)
 * Status: resolved