Title: fatal error on PHP 8
Last modified: January 20, 2022

---

# fatal error on PHP 8

 *  Resolved [Shane Bishop](https://wordpress.org/support/users/nosilver4u/)
 * (@nosilver4u)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-on-php-8-3/)
 * I was just going to test NextGEN with EWWW Image Optimizer in preparation for
   a release. When I activated NextGEN, I get these errors:
 *     ```
       [20-Jan-2022 22:23:49 UTC] PHP Warning:  Array to string conversion in /sites/test.exactlywww.com/files/wp-content/plugins/nextgen-gallery/non_pope/class.photocrati_transient_manager.php on line 120
       [20-Jan-2022 22:23:49 UTC] PHP Warning:  Only the first byte will be assigned to the string offset in /sites/test.exactlywww.com/files/wp-content/plugins/nextgen-gallery/non_pope/class.photocrati_transient_manager.php on line 120
       [20-Jan-2022 22:23:49 UTC] PHP Fatal error:  Uncaught Error: Cannot use string offset as an array in /sites/test.exactlywww.com/files/wp-content/plugins/nextgen-gallery/non_pope/class.photocrati_transient_manager.php:121
       Stack trace:
       #0 /sites/test.exactlywww.com/files/wp-content/plugins/nextgen-gallery/non_pope/class.photocrati_transient_manager.php(139): C_Photocrati_Transient_Manager->_track_key()
       #1 /sites/test.exactlywww.com/files/wp-content/plugins/nextgen-gallery/non_pope/class.photocrati_transient_manager.php(219): C_Photocrati_Transient_Manager->set()
       #2 /sites/test.exactlywww.com/files/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/wordpress_routing/package.module.wordpress_routing.php(21): C_Photocrati_Transient_Manager::update()
       #3 [internal function]: A_WordPress_Base_Url->cache_lookups()
       #4 {main}
         thrown in /sites/test.exactlywww.com/files/wp-content/plugins/nextgen-gallery/non_pope/class.photocrati_transient_manager.php on line 121
       ```
   
 * I haven’t used NextGEN in a while, but I just updated it. At first I thought 
   it was from the latest update, but then I remembered I’m on PHP 8 now, so it’s
   entirely possible it’s connected to that. Let me know if you need any other info.
   Theme is Twenty Twenty, and not many plugins active.

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

 *  Thread Starter [Shane Bishop](https://wordpress.org/support/users/nosilver4u/)
 * (@nosilver4u)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-on-php-8-3/#post-15274522)
 * Quick update, I swapped the site over to PHP 7.4 and still had the same errors.
 *  [Benjamin](https://wordpress.org/support/users/benjaminowens/)
 * (@benjaminowens)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-on-php-8-3/#post-15274625)
 * Hi [@nosilver4u](https://wordpress.org/support/users/nosilver4u/)
 * Could you try adding this to your wp-config.php:
 * `define('NGG_DISABLE_PHOTOCRATI_CACHE_TRACKER', true);`
 * and let me know if that resolves the issue.
 * Thanks!
 *  Thread Starter [Shane Bishop](https://wordpress.org/support/users/nosilver4u/)
 * (@nosilver4u)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-on-php-8-3/#post-15274639)
 * Nope, still throws the errors.
 *  [Benjamin](https://wordpress.org/support/users/benjaminowens/)
 * (@benjaminowens)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-on-php-8-3/#post-15274647)
 * It’s most likely then a complication with an external object cache; may I ask
   what other plugins you have active?
 * As a temporary workaround you could edit that file (nextgen-gallery/non_pope/
   class.photocrati_transient_manager.php) and comment lines 113 through 122 (the
   entirety of the `_track_key($key)` method — this makes it so that NextGEN can’t
   flush it’s transients, but that’s not a major problem as transients will expire
   eventually anyway.
 *  Thread Starter [Shane Bishop](https://wordpress.org/support/users/nosilver4u/)
 * (@nosilver4u)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-on-php-8-3/#post-15275081)
 * Yes, I do have an external object cache, though I’ve purged the object cache 
   several times (did it again just now). Also disabled all plugins, and the error
   remains. As you noted, I do see that particular code looks like it only runs 
   when object caching is enabled, and this is likely the first time I’ve ever had
   the plugin active on this environment.
 * The error indicates that $this->_tracker is a string rather than an array, and
   that property comes from the photocrati_cache_tracker option. I checked that 
   option, and it’s just set to “garbage”:
    `AA A A` (with spaces and all)
 * I emptied it to see if Nextgen would fix it, but it still throws the error on
   an empty value, even with an object cache purge.
 *  [Benjamin](https://wordpress.org/support/users/benjaminowens/)
 * (@benjaminowens)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-on-php-8-3/#post-15286282)
 * That’s unusual; can you show me what `debug_backtrace()` added after line 137
   results in; and what `$key` and `$value` are?
 * The next NGG release will include a check for the previously mentioned constant
   in the `_track_key()` method which will fix the problem, but if possible I’d 
   like to resolve the root issue too.
 * Thanks!
 *  Thread Starter [Shane Bishop](https://wordpress.org/support/users/nosilver4u/)
 * (@nosilver4u)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-on-php-8-3/#post-15286553)
 * Here’s what I got: [https://pastebin.com/xsZ81ADm](https://pastebin.com/xsZ81ADm)
 * That was supposed to be in the set() method, right?
 * In the _track_key() method, where the fatal error occurs, $this->_tracker is 
   an empty string. Thus $this->_tracker[$group] is treated as a string offset, 
   and when one tries to use it as an array via the [] assignment on this line, 
   that’s where the error happens:
    $this->_tracker[$group][] = $id;
 *  [Benjamin](https://wordpress.org/support/users/benjaminowens/)
 * (@benjaminowens)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-on-php-8-3/#post-15326494)
 * Thanks [@nosilver4u](https://wordpress.org/support/users/nosilver4u/)
 * I’ll have that fixed in the next NGG release; in the meanwhile just commenting
   out the code inside of the `_track_key()` method should allow your site to continue
   working until then.
 *  Thread Starter [Shane Bishop](https://wordpress.org/support/users/nosilver4u/)
 * (@nosilver4u)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-on-php-8-3/#post-15329686)
 * Great, thanks! I’ll be doing an EWWW IO release next week so I’ll watch for the
   NGG update and/or disable that code while I’m running through our compatibility
   testing.

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

The topic ‘fatal error on PHP 8’ is closed to new replies.

 * ![](https://ps.w.org/nextgen-gallery/assets/icon-256x256.png?rev=2083961)
 * [Photo Gallery, Sliders, Proofing and Themes - NextGEN Gallery](https://wordpress.org/plugins/nextgen-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/nextgen-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/nextgen-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/nextgen-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/nextgen-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/nextgen-gallery/reviews/)

 * 9 replies
 * 2 participants
 * Last reply from: [Shane Bishop](https://wordpress.org/support/users/nosilver4u/)
 * Last activity: [4 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-on-php-8-3/#post-15329686)
 * Status: resolved