Has anybody else seen this fatal error after upgrading to CiviCRM 5.3.2? It appears when trying to manage groups or create a new group in "Contacts" and I don't think we had this under 5.3.0.

The full error is:

Fatal error: Call to undefined function ctype_space() in /usr/local/www/wordpress/wp-content/plugins/civicrm/civicrm/packages/IDS/vendors/htmlpurifier/HTMLPurifier/Token/Text.php on line 26

We are running Wordpress 4.9.7 and PHP 5.6.37.

Any ideas and help is highly appreciated! Thank you!


Thanks to @Demerit I have run a couple of tests, and here are the results:

# pkg info php56-ctype php56-ctype-5.6.37 Name : php56-ctype Version : 5.6.37 Installed on : Fri Jul 27 16:42:39 2018 UTC Origin : textproc/php56-ctype Architecture : FreeBSD:11:amd64 (...)

So the ctype extension is installed.

# php --ini Configuration File (php.ini) Path: /usr/local/etc Loaded Configuration File: /usr/local/etc/php.ini Scan for additional .ini files in: /usr/local/etc/php Additional .ini files parsed: /usr/local/etc/php/ext-18-session.ini, /usr/local/etc/php/ext-20-ctype.ini, /usr/local/etc/php/ext-20-curl.ini, /usr/local/etc/php/ext-20-filter.ini, (...)

So the ctype extension seems to be activated. But now: when I use print_r(get_loaded_extensions()); I get

Array ( [0] => Core [1] => date [2] => ereg [3] => libxml [4] => pcre [5] => Reflection [6] => SPL [7] => hash [8] => session [9] => cgi-fcgi [10] => standard [11] => curl [12] => filter [13] => ftp [14] => gd [15] => mysqlnd [16] => json [17] => mbstring [18] => mysql [19] => mysqli [20] => openssl [21] => PDO [22] => SimpleXML [23] => tokenizer [24] => xml [25] => zip [26] => zlib [27] => pdo_mysql [28] => mhash )

So here it doesn't seem activated at all. And when I do phpinfo(); ext-20-ctype.ini doesn't appear in the list of parsed .ini files either. So again, it doesn't seem activated.

How is it possible that PHP provides contradictory info on the command line and via web browser? May this be linked to the fact that my CiviCRM and PHP is running in a FreeBSD jail?

Thank you for any ideas you might have!

2 Answers 2


I solved this thanks to the friendly help above. There were indeed php.ini's inside and outside of the jail, but they weren't really the problem (ctype was activated there). Instead, I had to restart php-fpm to make PHP notice them. Not sure why but it did the trick.


If it's the same hosting provider it would be odd to change all of a sudden but this error happens when the ctype php extension is not enabled. Ask your hosting provider.

  • Thank you @Demerit for your help. We're actually hosting it ourselves, running on a FreeBSD 11.2 server. The package php56-ctype-5.6.37 is installed. Do you know if there's something else we need to do to activate it in PHP?
    – Hans
    Commented Jul 28, 2018 at 20:20
  • Use phpinfo to confirm it's enabled. If not look in php.ini for the extension=ctype line.
    – Demerit
    Commented Jul 28, 2018 at 21:55
  • Thank you @Demerit, I have added some further about what I tried in the initial post. Would you mind having a look?
    – Hans
    Commented Jul 29, 2018 at 17:02
  • 1
    If there's a jail as mentioned in your update then yes there is likely another php.ini somewhere that is used for web under the jail root. Other OS's also sometimes have separate cli and web php.ini files even when not using a jail.
    – Demerit
    Commented Jul 29, 2018 at 19:19
  • @Demerit is correct. The info passed by php --ini shows the path to the particular php.ini file in use. If you create a file that just displays the output of phpinfo() and load it via a web page, you're very likely to get different results. Commented Jul 29, 2018 at 19:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.