Title: Fatal error: Cannot declare class
Last modified: January 2, 2019

---

# Fatal error: Cannot declare class

 *  Resolved [Richard](https://wordpress.org/support/users/rgenck/)
 * (@rgenck)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/fatal-error-cannot-declare-class/)
 * Just started getting the following error:
 * Fatal error: Cannot declare class JSMin_UnterminatedStringException, because 
   the name is already in use in /wp-content/plugins/psn-pagespeed-ninja/ress/vendor/
   jsmin-php/jsmin.php on line 395
 * Also got the following error, not sure if it’s related:
 * Fatal error: Unknown: Cannot use output buffering in output buffering display
   handlers in Unknown on line 0

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

 *  Plugin Author [Denis Ryabov](https://wordpress.org/support/users/dryabov/)
 * (@dryabov)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/fatal-error-cannot-declare-class/#post-11045572)
 * Most likely you have another active optimizing plugin that use JSMin library.
   Try to either disable that plugin, or disable JS minification (i.e. set “Minify
   Javascript Method” to “None” in the “Minify JavaScript” section of PageSpeed 
   Ninja Advanced settings).
 *  Thread Starter [Richard](https://wordpress.org/support/users/rgenck/)
 * (@rgenck)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/fatal-error-cannot-declare-class/#post-11045785)
 * Good to know, in your opinion do I need to use PageSpeed Ninja with Autoptimize,
   or should I not need Autoptimize?
 *  Plugin Author [Denis Ryabov](https://wordpress.org/support/users/dryabov/)
 * (@dryabov)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/fatal-error-cannot-declare-class/#post-11045822)
 * Most likely it’s better to use a single optimizing plugin (Autoptimize or PageSpeed
   Ninja) to don’t duplicate optimization tasks. If you like to use both, I’d try
   both ways and choose one that works better (i.e. gives higher PageSpeed Insights
   scores and takes less time to generate page).
 *  Thread Starter [Richard](https://wordpress.org/support/users/rgenck/)
 * (@rgenck)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/fatal-error-cannot-declare-class/#post-11045828)
 * Update: I also had Cloudflare going, I deleted Autoptimize and flushed the Cloudflare
   cache and the error is gone.
 * Thanks!
    -  This reply was modified 7 years, 5 months ago by [Richard](https://wordpress.org/support/users/rgenck/).

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

The topic ‘Fatal error: Cannot declare class’ is closed to new replies.

 * ![](https://ps.w.org/psn-pagespeed-ninja/assets/icon.svg?rev=1722219)
 * [PageSpeed Ninja - Cache, Minify, Defer CSS JavaScript, Critical CSS, Optimize Images, Convert WebP](https://wordpress.org/plugins/psn-pagespeed-ninja/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/psn-pagespeed-ninja/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/psn-pagespeed-ninja/)
 * [Active Topics](https://wordpress.org/support/plugin/psn-pagespeed-ninja/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/psn-pagespeed-ninja/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/psn-pagespeed-ninja/reviews/)

## Tags

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

 * 4 replies
 * 2 participants
 * Last reply from: [Richard](https://wordpress.org/support/users/rgenck/)
 * Last activity: [7 years, 5 months ago](https://wordpress.org/support/topic/fatal-error-cannot-declare-class/#post-11045828)
 * Status: resolved