Title: Parse Error Line 281 widgets.php
Last modified: August 22, 2016

---

# Parse Error Line 281 widgets.php

 *  Resolved [donwhite](https://wordpress.org/support/users/donwhite/)
 * (@donwhite)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/parse-error-line-281-widgetsphp/)
 * I updated one site today and received the following error:
 * _Parse error: syntax error, unexpected T\_FUNCTION in /home/shelbcot/public\_html/
   scta/wp-content/plugins/bbp-style-pack/includes/widgets.php on line 281_
 * However, on another site (the development site), it works perfectly.
 * The only big difference between the sites is in the first, WordPress is installed
   in a sub-directory with access being controlled via .htacess and index.php. In
   the development site an add-on domain (controlled by cPanel was used.
 * This is a very useful plugin and I’d hate to lose it.
 * Scratching my head.
 * Any assistance will be appreciated.
 * Don White
 * [https://wordpress.org/plugins/bbp-style-pack/](https://wordpress.org/plugins/bbp-style-pack/)

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

 *  Plugin Author [Robin W](https://wordpress.org/support/users/robin-w/)
 * (@robin-w)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/parse-error-line-281-widgetsphp/#post-5818495)
 * I’ve had a look, and there is nothing obviously wrong on that line.
 * However wordpress support says that there are two ways I could eb coding that
   line
 *     ```
       PHP 5.3+ only:
       add_action( 'widgets_init', function(){
            register_widget( 'My_Widget' );
       });
       ```
   
 *     ```
       PHP 5.2+:
       add_action('widgets_init',
            create_function('', 'return register_widget("My_Widget");')
       );
       ```
   
 * Do you know if these sites use different versions of php?
 *  Thread Starter [donwhite](https://wordpress.org/support/users/donwhite/)
 * (@donwhite)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/parse-error-line-281-widgetsphp/#post-5818514)
 * Hi Robin,
 * The main site, which does not work, uses php 5.2.17 and the development site 
   uses php 5.4.35.
 * I just tried the BackUpWordPress plugin on both sites and it crashes as well 
   on the main site.
 * Looks like the PHP version is the problem.
 * The client’s site is hosted with an outfit called dotEasy. I noticed on cPanel
   that all the software is a bit behind in getting updated.
 * My development site is on dotCanada and is working fine.
 * I guess I better get in touch with the dotEasy on behalf of the client and see
   if they’re planning on updating PHP.
 * Thanks for your prompt feedback.
 * Don
 *  Plugin Author [Robin W](https://wordpress.org/support/users/robin-w/)
 * (@robin-w)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/parse-error-line-281-widgetsphp/#post-5818535)
 * If you are not using the latest activity widget, you can just remove lines
 * 281-283 of the file
 * includes/widgets.php
 *  Thread Starter [donwhite](https://wordpress.org/support/users/donwhite/)
 * (@donwhite)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/parse-error-line-281-widgetsphp/#post-5818538)
 * Hi Robin,
 * I’ll comment those lines out for the time being until I get in touch with dotEasy.
 * Thanks again.
 * Don
 *  Plugin Author [Robin W](https://wordpress.org/support/users/robin-w/)
 * (@robin-w)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/parse-error-line-281-widgetsphp/#post-5818601)
 * no problem, if you get no joy and want the widget working, come back and I’ll
   give you the alternate lines

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

The topic ‘Parse Error Line 281 widgets.php’ is closed to new replies.

 * ![](https://ps.w.org/bbp-style-pack/assets/icon-256x256.jpg?rev=2706563)
 * [bbp style pack](https://wordpress.org/plugins/bbp-style-pack/)
 * [Support Threads](https://wordpress.org/support/plugin/bbp-style-pack/)
 * [Active Topics](https://wordpress.org/support/plugin/bbp-style-pack/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bbp-style-pack/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bbp-style-pack/reviews/)

## Tags

 * [T_FUNCTION](https://wordpress.org/support/topic-tag/t_function/)
 * [widgets.php](https://wordpress.org/support/topic-tag/widgets-php/)

 * 5 replies
 * 2 participants
 * Last reply from: [Robin W](https://wordpress.org/support/users/robin-w/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/parse-error-line-281-widgetsphp/#post-5818601)
 * Status: resolved