Title: __DIR__ throws errors
Last modified: August 21, 2016

---

# __DIR__ throws errors

 *  Resolved [PaulMighty](https://wordpress.org/support/users/paulmighty/)
 * (@paulmighty)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/_dir_-throws-errors/)
 * Activated the plugin and navigated to Tools > Post Type Icons and found the following
   errors that prevented the page from loading:
 * Notice: Use of undefined constant __DIR__ – assumed ‘__DIR__’ in [my website]/
   wp-content/plugins/post-type-icons/post-type-icons.php on line 66
 * Warning: require_once(__DIR__/font-awesome/class-pti-font-awesome.php) [function.
   require-once]: failed to open stream: No such file or directory in [my website]/
   wp-content/plugins/post-type-icons/post-type-icons.php on line 66
 * Fatal error: require_once() [function.require]: Failed opening required ‘__DIR__/
   font-awesome/class-pti-font-awesome.php’ (include_path=’.:/Applications/MAMP/
   bin/php/php5.2.17/lib/php’) in [my website]/wp-content/plugins/post-type-icons/
   post-type-icons.php on line 66
 * -PaulMighty
 * [http://wordpress.org/plugins/post-type-icons/](http://wordpress.org/plugins/post-type-icons/)

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

 *  Thread Starter [PaulMighty](https://wordpress.org/support/users/paulmighty/)
 * (@paulmighty)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/_dir_-throws-errors/#post-4532644)
 * Resolved by replacing two instances of __DIR__ with dirname(__FILE__), as suggested
   here: [http://stackoverflow.com/questions/14653947/php-5-2-notice-use-of-undefined-constant-dir-assumed-dir](http://stackoverflow.com/questions/14653947/php-5-2-notice-use-of-undefined-constant-dir-assumed-dir)
 * -PaulMighty
 *  Plugin Author [Matthew Boynes](https://wordpress.org/support/users/mboynes/)
 * (@mboynes)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/_dir_-throws-errors/#post-4532911)
 * This is also resolved in the latest version of the plugin.

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

The topic ‘__DIR__ throws errors’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/post-type-icons_efefef.svg)
 * [Post Type Icons](https://wordpress.org/plugins/post-type-icons/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/post-type-icons/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/post-type-icons/)
 * [Active Topics](https://wordpress.org/support/plugin/post-type-icons/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/post-type-icons/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/post-type-icons/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Matthew Boynes](https://wordpress.org/support/users/mboynes/)
 * Last activity: [12 years, 1 month ago](https://wordpress.org/support/topic/_dir_-throws-errors/#post-4532911)
 * Status: resolved