Error message · PHP sites: WordPress, Laravel, Joomla, Drupal, custom PHP

“Fatal error: Uncaught Error: Call to undefined function in /home/example/public_html/wp-content/plugins/example/example.php on line 42”

PHP stopped running the page at the file and line the message names, and because error display is on, the raw message is printed where the page should be. The file path tells you which plugin, theme or script failed; the words after "Uncaught Error" say what went wrong: a function or class that doesn't exist, a missing file, a type error, or memory running out.

Is your site showing it right now?

The free scan loads your page like a visitor and checks for this message, plus broken links, script errors and phone layout. It also walks your signup, booking or contact form, without sending anything.

​

Free, no signup. Usually done in about a minute.

Why it happens

  • A plugin, theme or library was updated (or half-updated) and now calls code that isn't there
  • The server's PHP version changed, and old code uses functions removed in the new version (or new code needs a newer version)
  • A file is missing after a deploy or a failed upload, or has a syntax error (a "Parse error")
  • The script ran out of memory ("Allowed memory size exhausted")
  • Two plugins define the same function or class

How to fix it

  1. Read the path in the message

    The file after "in" names the culprit: wp-content/plugins/<name> is that plugin, wp-content/themes/<name> that theme, vendor/<package> that library. The line number points at the exact call.

  2. Disable or update the named plugin or theme

    In WordPress, rename its folder with your host's file manager or FTP to deactivate it, then update or replace it. On other platforms, roll back the last change to that file or package.

  3. Match the PHP version

    If the error appeared after a PHP upgrade, switch back to the previous version in the hosting panel until the code is updated. If the message says a function requires a newer PHP, upgrade instead.

  4. Raise the memory limit if it's a memory error

    For WordPress add define('WP_MEMORY_LIMIT', '256M'); to wp-config.php; otherwise raise memory_limit in php.ini or .htaccess, or ask your host.

  5. Stop showing errors to visitors

    Set display_errors = Off in php.ini (WordPress: define('WP_DEBUG_DISPLAY', false);) and log errors instead. The error still needs fixing, but visitors shouldn't see server paths.

Questions

Is the message dangerous?

It shows the server's folder layout and software versions to anyone. Turn off display_errors once you've read the message.

Only part of the page is missing

The error happened partway through building the page, so everything after that point didn't render. The fix is the same.

Can Page Canary tell me if this comes back?

Yes. Page Canary checks your key pages every day for this message and others like it, confirms it on a second check, and emails you with the fix. One site is free.

Other error messages