Parse Error Line 281 widgets.php
-
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
-
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?
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
If you are not using the latest activity widget, you can just remove lines
281-283 of the file
includes/widgets.php
Hi Robin,
I’ll comment those lines out for the time being until I get in touch with dotEasy.
Thanks again.
Don
no problem, if you get no joy and want the widget working, come back and I’ll give you the alternate lines
- The topic ‘Parse Error Line 281 widgets.php’ is closed to new replies.