Back to Community

Fixing the 'Call to undefined function imagettftext()' Error in Really Simple CAPTCHA

24 threads Sep 16, 2025 PluginReally simple captcha

Content

If your WordPress site has suddenly crashed with a fatal error mentioning imagettftext(), imagetypes(), or a missing GD library, you're not alone. This is one of the most common issues users face with the Really Simple CAPTCHA plugin. This troubleshooting guide will explain why this error occurs and walk you through the steps to resolve it.

Why This Error Occurs

The Really Simple CAPTCHA plugin relies on specific PHP libraries to generate its security images. The two most critical libraries are:

  • GD library: Handles image creation and manipulation.
  • FreeType library: Specifically required to render text (the letters and numbers in the CAPTCHA) onto the image.

The error Call to undefined function imagettftext() means that while PHP's GD extension might be installed, it was compiled without support for FreeType. Without both, the plugin cannot function. This often happens after a server migration, a PHP version update, or a change in your hosting environment.

How to Fix It: A Step-by-Step Guide

Step 1: Confirm the Libraries Are Missing

First, you need to verify the status of these libraries on your server. The easiest way to do this is to create a simple phpinfo.php file.

  1. Create a new text file on your computer and name it phpinfo.php.
  2. Open the file and add this single line of code: <?php phpinfo(); ?>
  3. Save the file and upload it to the root directory of your WordPress installation (the same folder that contains wp-config.php).
  4. Open your web browser and go to https://yourdomain.com/phpinfo.php (replace with your actual domain).
  5. On the page that loads, press Ctrl + F (or Cmd + F on Mac) and search for "GD".
  6. Look for the "GD Support" section. It should say "enabled".
  7. Now, search for "FreeType". If you see "FreeType Support" listed as "enabled", your libraries are installed correctly. If it is missing or says "disabled", you have found the cause of the problem.
  8. Important: Delete the phpinfo.php file from your server after you finish, as it exposes sensitive information about your setup.

Step 2: Contact Your Web Host

If the libraries are missing or disabled, this is a server-level issue that must be resolved by your web hosting provider. You cannot install these libraries yourself on standard shared hosting.

What to ask them: Contact your host's support team and clearly state: "My PHP installation is missing FreeType support for the GD library. Please enable the GD and FreeType libraries for my account."

Many hosts can enable this with a simple change in your account's control panel (e.g., cPanel, Plesk) or by switching you to a different PHP handler. Be persistent—some support agents may initially say they are installed, but the phpinfo.php test is definitive proof.

Step 3: Check for Conflicts (Less Common)

In rare cases, your server might have the libraries installed, but another factor is causing a conflict.

  • PHP Modules: Some users have reported that the suhosin or suphp PHP modules can interfere, even with the correct libraries installed. Ask your host if these are active on your server.
  • Theme/Plugin Conflicts: As seen in some threads, a theme might bundle an outdated or modified version of the Really Simple CAPTCHA library, leading to a "Cannot redeclare class" error. To test for this, temporarily switch to a default WordPress theme (like Twenty Twenty-One) and deactivate all other plugins. If the error disappears, reactivate them one by one to find the culprit.

Summary

The 'undefined function imagettftext()' error is almost always a server configuration issue, not a bug in the Really Simple CAPTCHA plugin itself. The solution requires ensuring your hosting environment has the GD and FreeType libraries properly installed and enabled. Your first and most important step is to contact your web host with the evidence from your phpinfo.php test.

Related Support Threads Support