Title: Plugin could not be activated
Last modified: August 22, 2016

---

# Plugin could not be activated

 *  Resolved [maximnj](https://wordpress.org/support/users/maximnj/)
 * (@maximnj)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/plugin-could-not-be-activated-16/)
 * Hello, I’m trying to activate this plugin but WP (4.0.1) says that plugin could
   not be activated because it triggered a fatal error:
 * syntax error, unexpected T_FUNCTION in crosswordsearch.php on line 903
 * I did check this line and it looks OK but I am not a php-man, sorry.
 * There is the block of code below and line 903 which cause the error is marked
   with “line 903” remark. Could you give me any suggestion what to do?
 * function crw_update_capabilities () {
    global $wp_roles; $error = __(‘Editing
   rights could not be updated.’, ‘crw-text’);
 *  crw_test_permission( ‘cap’, wp_get_current_user() );
 *  $capabilities = json_decode( wp_unslash( $_POST[‘capabilities’] ) );
    if ( !
   is_array($capabilities) ) { $debug = ‘invalid data: no array’; crw_send_error(
   $error, $debug); }
 *  $allowed = array(CRW_CAP_CONFIRMED, CRW_CAP_UNCONFIRMED, ”);
    $roles_caps = 
   array(); foreach ( $wp_roles->role_objects as $name => $role ) {
 * _/**line 903**/_ $list = array_filter($capabilities, function ($entry) use ($
   name) {
 *  return is_object($entry) && $entry->name === $name;
    } ); $cap_obj = current(
   $list ); if ( !$cap_obj ) { $debug = ‘role missing: ‘ . $name; crw_send_error(
   $error, $debug); } elseif ( !in_array( $cap_obj->cap, $allowed, true ) ) { $debug
   = ‘corrupt role: ‘ . $name . ‘, ‘ . $cap_obj->cap; crw_send_error($error, $debug);}
   if (” !== $cap_obj->cap) { $roles_caps[$name] = $cap_obj->cap; } };
 *  update_option(CRW_ROLES_OPTION, $roles_caps);
    foreach ( $wp_roles->role_objects
   as $name => $role ) { $role->remove_cap( CRW_CAP_CONFIRMED ); $role->remove_cap(
   CRW_CAP_UNCONFIRMED ); if ( array_key_exists($name, $roles_caps) ) { $role->add_cap(
   $roles_caps[$name] ); } }
 *  crw_send_capabilities();
    } add_action( ‘wp_ajax_update_crw_capabilities’, ‘
   crw_update_capabilities’ );
 * [https://wordpress.org/plugins/crosswordsearch/](https://wordpress.org/plugins/crosswordsearch/)

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

 *  Plugin Author [ccprog](https://wordpress.org/support/users/ccprog/)
 * (@ccprog)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/plugin-could-not-be-activated-16/#post-5652970)
 * This looks like you are running on a fairly old version of PHP (less than 5.3,
   which was released in 2009).
 * I just saw that WordPress [promises](https://wordpress.org/about/requirements/)
   to run on PHP version 5.2.4 or greater, while this plugin currently requires 
   at least version 5.3.
 * Sorry, but this doesn’t look as if it could be quickly resolved. Do you have 
   any chance of running a newer PHP?
 *  Thread Starter [maximnj](https://wordpress.org/support/users/maximnj/)
 * (@maximnj)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/plugin-could-not-be-activated-16/#post-5652979)
 * Thank you for instant reply. I’ve checked this situation on the hosting I use
   for my site. It says I’m running PHP 5.4.24. My WP is 4.0.1. What else should
   be checked?
 *  Plugin Author [ccprog](https://wordpress.org/support/users/ccprog/)
 * (@ccprog)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/plugin-could-not-be-activated-16/#post-5652986)
 * After looking around, I have found this error is only mentioned in conjunction
   with old PHP versions. (And the programm using so-called “anonymous functions”,
   which the plugin does in the offending line.)
 * But regularly there were reports of someone saying they had PHP 5.4.x, only to
   come back later to say that after checking again it was in fact PHP 5.2.x. ([Here](https://wordpress.org/support/topic/fatal-error-954?replies=11)
   is a fairly typical conversation.)
 * One way to check what your hoster does would be to upload a file info.php (or
   any other appropriate name) containing this:
 * >  <?php
   >  phpinfo(); ?>
 * Calling this page will output information about the config actually running.
 * It could be worth looking around if there might be a way your hoster lets you
   _choose_ which version of PHP to use.
 *  Thread Starter [maximnj](https://wordpress.org/support/users/maximnj/)
 * (@maximnj)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/plugin-could-not-be-activated-16/#post-5653013)
 * Thank you for advice. I wrote to technical support and they confirmed that PHP
   was 5.3 ))). Now it’s upgraded to 5.4. Will try to activate again and come back
   with results.
 *  Thread Starter [maximnj](https://wordpress.org/support/users/maximnj/)
 * (@maximnj)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/plugin-could-not-be-activated-16/#post-5653014)
 * It’s done! Thank you once again for your help!
 *  Plugin Author [ccprog](https://wordpress.org/support/users/ccprog/)
 * (@ccprog)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/plugin-could-not-be-activated-16/#post-5653025)
 * Unless someone persuades me that support for PHP 5.2 is absolutely necessary,
   I close this topic as “won’t fix”.

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

The topic ‘Plugin could not be activated’ is closed to new replies.

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

## Tags

 * [fatal error](https://wordpress.org/support/topic-tag/fatal-error/)
 * [syntax error](https://wordpress.org/support/topic-tag/syntax-error/)
 * [unexpected T_function](https://wordpress.org/support/topic-tag/unexpected-t_function/)

 * 6 replies
 * 2 participants
 * Last reply from: [ccprog](https://wordpress.org/support/users/ccprog/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/plugin-could-not-be-activated-16/#post-5653025)
 * Status: resolved