Answers.Body: <p>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 <code>php-fpm</code> to make PHP notice them. Not sure why but it did the trick.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-31T14:10:30.657Z
Answers.LastActivityDate: 2018-07-31T14:10:30.657Z
Answers.UserDisplayName: Hans
Answers.Body: <p>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.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-28T20:20:09.417Z
Answers.Text: 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?
Answers.UserDisplayName: Hans
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-28T21:55:44.827Z
Answers.Text: Use phpinfo to confirm it's enabled. If not look in php.ini for the extension=ctype line.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-29T17:02:08.247Z
Answers.Text: Thank you @Demerit, I have added some further about what I tried in the initial post. Would you mind having a look?
Answers.UserDisplayName: Hans
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-29T19:19:06.377Z
Answers.Text: 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.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-29T19:29:03.243Z
Answers.Text: @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.
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-27T19:32:26.970Z
Answers.LastActivityDate: 2018-07-27T19:32:26.970Z
Answers.UserDisplayName: Demerit
Body: <p>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. </p>
  
  <p>The full error is:</p>
  
  <p><code>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</code></p>
  
  <p>We are running Wordpress 4.9.7 and PHP 5.6.37.</p>
  
  <p>Any ideas and help is highly appreciated! Thank you!</p>
  
  <p><strong>EDIT1:</strong></p>
  
  <p>Thanks to @Demerit I have run a couple of tests, and here are the results:</p>
  
  <p><code># 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
  (...)</code></p>
  
  <p>So the ctype extension is installed.</p>
  
  <p><code># 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,
  (...)</code></p>
  
  <p>So the ctype extension seems to be activated. But now: when I use <code>print_r(get_loaded_extensions());</code> I get </p>
  
  <p><code>Array ( [0] =&gt; Core [1] =&gt; date [2] =&gt; ereg [3] =&gt; libxml [4] =&gt; pcre [5] =&gt; Reflection [6] =&gt; SPL [7] =&gt; hash [8] =&gt; session [9] =&gt; cgi-fcgi [10] =&gt; standard [11] =&gt; curl [12] =&gt; filter [13] =&gt; ftp [14] =&gt; gd [15] =&gt; mysqlnd [16] =&gt; json [17] =&gt; mbstring [18] =&gt; mysql [19] =&gt; mysqli [20] =&gt; openssl [21] =&gt; PDO [22] =&gt; SimpleXML [23] =&gt; tokenizer [24] =&gt; xml [25] =&gt; zip [26] =&gt; zlib [27] =&gt; pdo_mysql [28] =&gt; mhash )</code></p>
  
  <p>So here it doesn't seem activated at all. And when I do <code>phpinfo();</code> ext-20-ctype.ini doesn't appear in the list of parsed .ini files either. So again, it doesn't seem activated.</p>
  
  <p>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?</p>
  
  <p>Thank you for any ideas you might have!</p>
  
Tags: <wordpress><php>
Title: Fatal error: Call to undefined function ctype_space()
ThreadText: # Fatal error: Call to undefined function ctype_space()
  
  (Asked by: username_0 on 2018-07-27)
  
  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!
  
  **EDIT1:**
  
  Thanks to @username_1 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!
  
  **Tags:** wordpress, php
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2018-07-31. Score: 2 | Accepted answer
  
  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.
  
  
  ---
  
  ### Answer by username_1 on 2018-07-27. Score: 1
  
  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.
  
  > **Comments:**
  > **username_0**: Thank you @username_1 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?  
  > **username_1**: Use phpinfo to confirm it's enabled. If not look in php.ini for the extension=ctype line.  
  > **username_0**: Thank you @username_1, I have added some further about what I tried in the initial post. Would you mind having a look?  
  > **username_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.  
  > **username_2**: @username_1 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.  
  
  ---
  
  