Title: PHP Fatal Error &#8211; Cannot declare class M_Attach_To_Post
Last modified: March 20, 2024

---

# PHP Fatal Error – Cannot declare class M_Attach_To_Post

 *  Resolved [jononoy](https://wordpress.org/support/users/jononoy/)
 * (@jononoy)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/php-fatal-error-cannot-declare-class-m_attach_to_post/)
 * Believe it’s a relatively new thing, perhaps since 3.59 update.
 * PHP Fatal error: Cannot declare class M_Attach_To_Post, because the name is already
   in use in /home/[HIDDEN]/public_html/wp-content/plugins/nextgen-gallery/products/
   photocrati_nextgen/modules/attach_to_post/module.attach_to_post.php on line 6
 * Running PHP 8.1. Had to disable plugin to get into WP-Admin. Can’t reenable as
   triggers the fatal error.

The topic ‘PHP Fatal Error – Cannot declare class M_Attach_To_Post’ 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/)

 * 0 replies
 * 1 participant
 * Last reply from: [jononoy](https://wordpress.org/support/users/jononoy/)
 * Last activity: [2 years, 2 months ago](https://wordpress.org/support/topic/php-fatal-error-cannot-declare-class-m_attach_to_post/)
 * Status: resolved