Title: Fatal Error— Plugin broken
Last modified: May 16, 2017

---

# Fatal Error— Plugin broken

 *  Resolved [andrewinsideout](https://wordpress.org/support/users/andrewinsideout/)
 * (@andrewinsideout)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/fatal-error-plugin-broken/)
 * Fatal error: Class ‘PicaticAPI’ not found in /…/wp/wp-content/plugins/picatic/
   picatic-lib.php on line 135
 * This is from a fresh install of wordpress and the Picatic plugin.

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

 *  Plugin Author [picatic](https://wordpress.org/support/users/picatic/)
 * (@picatic)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/fatal-error-plugin-broken/#post-9138107)
 * [@andrewinsideout](https://wordpress.org/support/users/andrewinsideout/), are
   you working on this in a localhost environment?
 * The problem appears to be that the vendor library that communicates with our 
   API is not loading. We use composer to load the vendor libraries and there are
   occasionally issues around doing this when working in localhost.
 * Which screen are you on (what are you doing) when you see this error.
 *  Thread Starter [andrewinsideout](https://wordpress.org/support/users/andrewinsideout/)
 * (@andrewinsideout)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/fatal-error-plugin-broken/#post-9315732)
 * I’m not working locally. This error is happening when I try to use the shortcode“[
   picatic-upcoming-events][/picatic-upcoming-events]”.
 *  Plugin Author [picatic](https://wordpress.org/support/users/picatic/)
 * (@picatic)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/fatal-error-plugin-broken/#post-9318454)
 * [@andrewinsideout](https://wordpress.org/support/users/andrewinsideout/), we’re
   having difficulty reproducing the error. Would you be able to supply us with 
   more details?
    - What screen do you see the error on, the edit page, or the public page?
    - What host are you using? What server environment are you running (LAMP?)? 
      What version of PHP?
 *  Thread Starter [andrewinsideout](https://wordpress.org/support/users/andrewinsideout/)
 * (@andrewinsideout)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/fatal-error-plugin-broken/#post-9319457)
 * Running LAMP with WordPress 4.8. PHP 5.6.30. The backend of the plugin works 
   well, I receive the fatal error on the front end of the site.
 * I’ve checked the file /plugins/picatic/vendor/picatic/php-api/src/PicaticAPI.
   php and the file is there with the correct permissions.
    -  This reply was modified 8 years, 9 months ago by [andrewinsideout](https://wordpress.org/support/users/andrewinsideout/).
    -  This reply was modified 8 years, 9 months ago by [andrewinsideout](https://wordpress.org/support/users/andrewinsideout/).
    -  This reply was modified 8 years, 9 months ago by [andrewinsideout](https://wordpress.org/support/users/andrewinsideout/).
 *  Thread Starter [andrewinsideout](https://wordpress.org/support/users/andrewinsideout/)
 * (@andrewinsideout)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/fatal-error-plugin-broken/#post-9320000)
 * If it helps I hacked it to work by adding this code to the top of picatic-lib.
   php
 *     ```
       if(!function_exists('http_build_url'))
               include_once(__DIR__.'/vendor/jakeasmith/http_build_url/src/http_build_url.php');
       if(!class_exists('Picatic_Consumer_Interface'))
               include_once(__DIR__.'/vendor/picatic/php-api/src/Picatic_Consumer_Interface.php');
       if(!class_exists('Picatic_Requestor_Interface'))
               include_once(__DIR__.'/vendor/picatic/php-api/src/Picatic_Requestor_Interface.php');
       if(!class_exists('Picatic_Requestor'))
               include_once(__DIR__.'/vendor/picatic/php-api/src/Picatic_Requestor.php');
       if(!class_exists('PicaticAPI'))
               include_once(__DIR__.'/vendor/picatic/php-api/src/PicaticAPI.php');
       ```
   
    -  This reply was modified 8 years, 9 months ago by [andrewinsideout](https://wordpress.org/support/users/andrewinsideout/).
    -  This reply was modified 8 years, 9 months ago by [andrewinsideout](https://wordpress.org/support/users/andrewinsideout/).
 *  Plugin Author [picatic](https://wordpress.org/support/users/picatic/)
 * (@picatic)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/fatal-error-plugin-broken/#post-9341145)
 * Hey [@andrewinsideout](https://wordpress.org/support/users/andrewinsideout/),
   sorry for the delay in replying.
    The above makes sense that it would work. I’m
   thinking that the problem is that in the picatic.php file on line 42, we include“
   vendor/autoload.php”. I’m guessing that because of the lack of __DIR__ in front
   of the path, it is having difficulty finding the file to load vendor dependencies.
 * Would it be possible for you to check to see if this fix would work instead of
   what you implemented?
 * So, remove the code you added above and try this instead in picatic.php line 
   42:
    `include(plugin_dir_path( __FILE__ ) . ‘vendor/autoload.php’);
 * Thanks
    -  This reply was modified 8 years, 8 months ago by [picatic](https://wordpress.org/support/users/picatic/).

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

The topic ‘Fatal Error— Plugin broken’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/picatic_ca4189.svg)
 * [Picatic](https://wordpress.org/plugins/picatic/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/picatic/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/picatic/)
 * [Active Topics](https://wordpress.org/support/plugin/picatic/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/picatic/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/picatic/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [picatic](https://wordpress.org/support/users/picatic/)
 * Last activity: [8 years, 8 months ago](https://wordpress.org/support/topic/fatal-error-plugin-broken/#post-9341145)
 * Status: resolved