Title: Error when enabling plugin
Last modified: August 31, 2016

---

# Error when enabling plugin

 *  Resolved [BB3lions](https://wordpress.org/support/users/bb3lions/)
 * (@bb3lions)
 * [10 years ago](https://wordpress.org/support/topic/error-when-enabling-plugin-1/)
 * Hi Raam,
 * I am unsure if this is something you can help fix but when i install/enable your
   plugin i receive the following error message.
 * Warning: require_once(__DIR__/plugin.php) [function.require-once]: failed to 
   open stream: No such file or directory in /websites/LinuxPackage05/7y/tz/nj/7ytznj-
   256344.webfusion-hosting.co.uk/public_html/wp-content/plugins/comet-cache/comet-
   cache.php on line 17
 * Fatal error: require_once() [function.require]: Failed opening required ‘__DIR__/
   plugin.php’ (include_path=’.:/usr/local/php52/share/pear:/usr/local/php52/share/
   php’) in /websites/LinuxPackage05/7y/tz/nj/7ytznj-256344.webfusion-hosting.co.
   uk/public_html/wp-content/plugins/comet-cache/comet-cache.php on line 17
 * [https://wordpress.org/plugins/comet-cache/](https://wordpress.org/plugins/comet-cache/)

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

 *  [Raam Dev](https://wordpress.org/support/users/raamdev/)
 * (@raamdev)
 * [10 years ago](https://wordpress.org/support/topic/error-when-enabling-plugin-1/#post-7350789)
 * [@bb3lions](https://wordpress.org/support/users/bb3lions/) It looks like your
   copy of Comet Cache is corrupt. I suggest downloading a new copy and trying the
   installation again.
 *  [mDuh](https://wordpress.org/support/users/mduh/)
 * (@mduh)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/error-when-enabling-plugin-1/#post-7350895)
 * Hello,
 * I have the same problem. First time installed plugin through admin (found plugin
   via search), second time manually. Both ended with the same result- fatal error.
 * Warning: require_once(__DIR__/plugin.php) [function.require-once]: failed to 
   open stream: No such file or directory in /home/fitnesop/public_html/wp-content/
   plugins/comet-cache/comet-cache.php on line 17
 * Fatal error: require_once() [function.require]: Failed opening required ‘__DIR__/
   plugin.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/fitnesop/
   public_html/wp-content/plugins/comet-cache/comet-cache.php on line 17
 *  [Raam Dev](https://wordpress.org/support/users/raamdev/)
 * (@raamdev)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/error-when-enabling-plugin-1/#post-7350896)
 * [@mduh](https://wordpress.org/support/users/mduh/) Can you tell me which version
   of PHP your site is using?
 *  [Raam Dev](https://wordpress.org/support/users/raamdev/)
 * (@raamdev)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/error-when-enabling-plugin-1/#post-7350897)
 * [@bb3lions](https://wordpress.org/support/users/bb3lions/) [@mduh](https://wordpress.org/support/users/mduh/)
   My only guess is that you’re both using something older than PHP 5.3, as that’s
   the version where the `__DIR__` magic constant was introduced. The `comet-cache.
   php` file is very simple: It just loads `plugin.php`, but it does so using a 
   magic constant to figure out the full path to that file:
 * `__DIR__/plugin.php`
 * Comet Cache requires PHP 5.4+ and there’s a version check that prevents Comet
   Cache from crashing when you’re running something older than PHP 5.4, but that
   version check happens inside `plugin.php`, which is too late to catch the fact
   that the `__DIR__` magic constant might cause a fatal error if you try installing
   on something older than PHP 5.3.
 * I’ll open a GitHub issue so that we can get this fixed in the next version, but
   if you could confirm that you’re running something older than PHP 5.3, that would
   help confirm this.
 *  [mDuh](https://wordpress.org/support/users/mduh/)
 * (@mduh)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/error-when-enabling-plugin-1/#post-7350898)
 * Unfortunately 5.2.17
 *  [Raam Dev](https://wordpress.org/support/users/raamdev/)
 * (@raamdev)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/error-when-enabling-plugin-1/#post-7350899)
 * [@mduh](https://wordpress.org/support/users/mduh/) Thank you for the confirmation.
   That confirms my suspicion. I highly recommend upgrading. Using an old unsupported
   version of PHP may expose you to security vulnerabilities and bugs that have 
   been fixed in more recent versions of PHP.
 * [WordPress recommends using PHP 5.6 or higher](https://wordpress.org/about/requirements/).
 *  [mDuh](https://wordpress.org/support/users/mduh/)
 * (@mduh)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/error-when-enabling-plugin-1/#post-7350900)
 * I can only change hosting provider, because I’m sure they are aware of the situation,
   but just don’t care. 🙂 Thank you anyway, at least we found the cause of fatal
   error.

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

The topic ‘Error when enabling plugin’ is closed to new replies.

 * ![](https://ps.w.org/comet-cache/assets/icon-256x256.png?rev=1348602)
 * [Comet Cache](https://wordpress.org/plugins/comet-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/comet-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/comet-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/comet-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/comet-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/comet-cache/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [mDuh](https://wordpress.org/support/users/mduh/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/error-when-enabling-plugin-1/#post-7350900)
 * Status: resolved