Title: PHP 8.1 compatible?
Last modified: April 18, 2022

---

# PHP 8.1 compatible?

 *  Resolved [webmasterdistrict10nia](https://wordpress.org/support/users/webmasterdistrict10nia/)
 * (@webmasterdistrict10nia)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/php-8-1-compatible-3/)
 * Hello, while updating our site from PHP 7.4FastGCI to PHP 8.0Fast GCI, errors
   were found in Document Gallery that prevented the update from finishing. Have
   others reported issues with it? I am not a tech person, so I am looking for suggestions
   to remedy the situation.
    Thank you, _[ email deleted ]_
    -  This topic was modified 4 years, 1 month ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).

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

 *  [Jose Mortellaro](https://wordpress.org/support/users/giuse/)
 * (@giuse)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/php-8-1-compatible-3/#post-15568071)
 * Hi [@webmasterdistrict10nia](https://wordpress.org/support/users/webmasterdistrict10nia/)
 * The plugin looks abandoned, I don’t think the authors will read this thread.
 * I had the same problem with PHP 8.
 * You can fix it by moving DG_Gallery::init(); to the bottom of the file in document-
   gallery-3/inc/class-gallery.php. It works for me after moving that line of code
   to the bottom.
 *  [scshca](https://wordpress.org/support/users/scshca/)
 * (@scshca)
 * [3 years, 12 months ago](https://wordpress.org/support/topic/php-8-1-compatible-3/#post-15727739)
 * Thanks [@giuse](https://wordpress.org/support/users/giuse/), that edit fixed 
   the issue on PHP 8 for my website as well.
 *  [Jose Mortellaro](https://wordpress.org/support/users/giuse/)
 * (@giuse)
 * [3 years, 12 months ago](https://wordpress.org/support/topic/php-8-1-compatible-3/#post-15727843)
 * You are welcome [@scshca](https://wordpress.org/support/users/scshca/). I’m happy
   that it was useful.
 *  Thread Starter [webmasterdistrict10nia](https://wordpress.org/support/users/webmasterdistrict10nia/)
 * (@webmasterdistrict10nia)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/php-8-1-compatible-3/#post-15744141)
 * Jose, where do I find that code in order to move it? I am not an IT guy but have
   friends that are and are willing to help.
    Thanks, Mark
 *  [viwickam](https://wordpress.org/support/users/viwickam/)
 * (@viwickam)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/php-8-1-compatible-3/#post-15782850)
 * Thanks for the patch, [@giuse](https://wordpress.org/support/users/giuse/)!
 * That fixed it for me in php8 as well. 🙂
 * Vi
 *  Thread Starter [webmasterdistrict10nia](https://wordpress.org/support/users/webmasterdistrict10nia/)
 * (@webmasterdistrict10nia)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/php-8-1-compatible-3/#post-15904584)
 * Where do I find that code? In the “details” section of the DG plugin description
   bar when looking at the Plugin description? In the sites webserver?
 * Thanks,
    Mark
 *  [Jose Mortellaro](https://wordpress.org/support/users/giuse/)
 * (@giuse)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/php-8-1-compatible-3/#post-15909192)
 * Hi [@webmasterdistrict10nia](https://wordpress.org/support/users/webmasterdistrict10nia/)
 * > You can fix it by moving DG_Gallery::init(); to the bottom of the file in document-
   > gallery-3/inc/class-gallery.php. It works for me after moving that line of 
   > code to the bottom.
 * So, the file in document-gallery-3/inc/class-gallery.php.
 * I suggest hiring a developer and giving them the link to this thread.
 * If you or your friends don’t know how to find and edit that file better you hire
   a developer.
 *  [Jose Mortellaro](https://wordpress.org/support/users/giuse/)
 * (@giuse)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/php-8-1-compatible-3/#post-15909198)
 * You are welcome [@viwickam](https://wordpress.org/support/users/viwickam/) !
 *  [marxveix](https://wordpress.org/support/users/marxveix/)
 * (@marxveix)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/php-8-1-compatible-3/#post-16369453)
 * Hi Jose,
 * You can fix it by moving DG_Gallery::init(); to the bottom of the file in document-
   gallery-3/inc/class-gallery.php. It works for me after moving that line of code
   to the bottom.
 * I did that, still the same with my document gallery, wordpress 6.1.1 and tested
   with php 8, php 8.1 and php 8.2, if i return to php 7.4 then it works with the
   edited class-gallery.php as well, no need to copy original class-gallery.php 
   back to inc folder. How i can fix it, so it works with newer php?
 * Aadress where it does not work is here: [https://hingetee.ee/dokumendid/](https://hingetee.ee/dokumendid/)
 * Thank you,
 * Marx
 *  [Ivan Antipov](https://wordpress.org/support/users/ivantipov/)
 * (@ivantipov)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/php-8-1-compatible-3/#post-16378062)
 * Another PHP 8 fix was changing the order of parameters in `inc/class-gallery.
   php:544` to `implode( ', ', $ids )`.
 * Shame the project was abandoned, does what I needed really well.

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

The topic ‘PHP 8.1 compatible?’ is closed to new replies.

 * ![](https://ps.w.org/document-gallery/assets/icon.svg?rev=983329)
 * [Document Gallery](https://wordpress.org/plugins/document-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/document-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/document-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/document-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/document-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/document-gallery/reviews/)

 * 11 replies
 * 6 participants
 * Last reply from: [Ivan Antipov](https://wordpress.org/support/users/ivantipov/)
 * Last activity: [3 years, 4 months ago](https://wordpress.org/support/topic/php-8-1-compatible-3/#post-16378062)
 * Status: resolved