Title: syntax error, unexpected T_FUNCTION, PHP 5.4.43
Last modified: August 30, 2016

---

# syntax error, unexpected T_FUNCTION, PHP 5.4.43

 *  ResolvedPlugin Author [Khang Minh](https://wordpress.org/support/users/oddoneout/)
 * (@oddoneout)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-3/)
 * Continued from here: [https://wordpress.org/support/topic/no-longer-works-with-cf7-41/page/2?replies=39](https://wordpress.org/support/topic/no-longer-works-with-cf7-41/page/2?replies=39)
 * Things to try:
 * 1. Removing the plugin folder entirely and then reinstall.
    2. Replacing line
   51-53 with:
 *     ```
       add_filter('bwp_capt_init_priority', create_function('', 'return 9;'));
       ```
   
 * [https://wordpress.org/plugins/bwp-recaptcha/](https://wordpress.org/plugins/bwp-recaptcha/)

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-3/page/2/?output_format=md&replies=1)
[→](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-3/page/2/?output_format=md&replies=1)

 *  [Rojaws_abc](https://wordpress.org/support/users/rojaws_abc/)
 * (@rojaws_abc)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-3/#post-6461938)
 * Nope!
 * Results in a white admin main page although menu is still present as is the site.
 *  Plugin Author [Khang Minh](https://wordpress.org/support/users/oddoneout/)
 * (@oddoneout)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-3/#post-6461961)
 * That is after you try step 2 I mentioned above?
 *  [ty_h11](https://wordpress.org/support/users/ty_h11/)
 * (@ty_h11)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-3/#post-6462005)
 * I am having this same issue. I tried both steps above with no luck. And, yes,
   you get the white admin page when you change the code as listed above and then
   hit activate. I tried changing the code back to the way it was originally and
   upon reloading the plugin page on the admin side it throws a “500 internal server
   error”.
 * I am going to try and upload an older version and see if it comes back!
 *  Plugin Author [Khang Minh](https://wordpress.org/support/users/oddoneout/)
 * (@oddoneout)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-3/#post-6462008)
 * [@ty_h11](https://wordpress.org/support/users/ty_h11/) are you also using PHP
   5.4.43? Can you contact me via: [http://betterwp.net/contact/](http://betterwp.net/contact/)?
 *  [sppadbase](https://wordpress.org/support/users/sppadbase/)
 * (@sppadbase)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-3/#post-6462037)
 * Hello. I confirm what’s happening to other users (blank plugins page), along 
   with the fatal error message while trying to activate the plugin:
 * `Parse error: syntax error, unexpected T_FUNCTION in /home/sites/[site]/wordpress/
   wp-content/plugins/bwp-recaptcha/bwp-recaptcha.php on line 51`
 *  I’m using an older php version (5.2.4).
 *  Plugin Author [Khang Minh](https://wordpress.org/support/users/oddoneout/)
 * (@oddoneout)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-3/#post-6462038)
 * It should have shown an error message in dashboard rather than a fatal error,
   I’m checking this issue.
 * [@sppadbase](https://wordpress.org/support/users/sppadbase/) recaptcha version
   2 requires at least PHP 5.3.2, is it possible for you to update to that version?
   It might be pretty easy, just contact your host. PHP 5.2 is way too old now.
 *  [sppadbase](https://wordpress.org/support/users/sppadbase/)
 * (@sppadbase)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-3/#post-6462039)
 * To be precise, the message is this:
    `Plugin could not be activated because it
   triggered a fatal error.` `Parse error: syntax error, unexpected T_FUNCTION in/
   home/sites/sppadbase/wordpress/wp-content/plugins/bwp-recaptcha/bwp-recaptcha.
   php on line 51`
 * I’m now in touch with host admins…
 *  Plugin Author [Khang Minh](https://wordpress.org/support/users/oddoneout/)
 * (@oddoneout)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-3/#post-6462055)
 * OK this will be fixed in 2.0.2, however it’s still recommended to update to at
   least PHP 5.3 to benefit from the new recaptcha.
 * Oh and btw, by “blank admin page” do you mean the menu is still visible but when
   you click on it there’s nothing shown?
 *  [pmelick](https://wordpress.org/support/users/pmelick/)
 * (@pmelick)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-3/#post-6462069)
 * I deleted the plugin and replaced line 51-52 as you suggested. I received these
   errors after I activated it:
 * Warning: require_once(__DIR__/vendor/kminh/bwp-framework/src/class-bwp-version.
   php) [function.require-once]: failed to open stream: No such file or directory
   in /home/pnwqua5/public_html/test_conference_wordpress/wp-content/plugins/bwp-
   recaptcha/bwp-recaptcha.php on line 32
 * Fatal error: require_once() [function.require]: Failed opening required ‘__DIR__/
   vendor/kminh/bwp-framework/src/class-bwp-version.php’ (include_path=’.:/usr/lib/
   php:/usr/local/lib/php’) in /home/pnwqua5/public_html/test_conference_wordpress/
   wp-content/plugins/bwp-recaptcha/bwp-recaptcha.php on line 32
 * I can’t access anything on my dashboard once I get this message. The only way
   I’ve found to get around this is to delete the plugin directory entirely. I am
   running WP 4.03 and PHP Version 5.4.43.
 *  Plugin Author [Khang Minh](https://wordpress.org/support/users/oddoneout/)
 * (@oddoneout)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-3/#post-6462073)
 * [@pmelick](https://wordpress.org/support/users/pmelick/) I’m pretty certain that
   you’re not running PHP 5.4.43, as you can see in the log `__DIR__` is not parsed
   by PHP at all. I will upload 2.0.2 somewhere for you guys to test, but in the
   meantime can you check with your host why you got 5.4.43?
 *  [pmelick](https://wordpress.org/support/users/pmelick/)
 * (@pmelick)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-3/#post-6462075)
 * [@khang](https://wordpress.org/support/users/khang/) Minh You’re right. I’m actually
   running PHP Version 5.4.45 . I’m sure because I copied it directly from my site
   stats.
 *  Plugin Author [Khang Minh](https://wordpress.org/support/users/oddoneout/)
 * (@oddoneout)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-3/#post-6462076)
 * [@pmelick](https://wordpress.org/support/users/pmelick/) can you try this version
   out?
 * [https://downloads.wordpress.org/plugin/bwp-recaptcha.zip](https://downloads.wordpress.org/plugin/bwp-recaptcha.zip)
 *  Plugin Author [Khang Minh](https://wordpress.org/support/users/oddoneout/)
 * (@oddoneout)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-3/#post-6462078)
 * Is the version linked above working for you guys? Please reply so I can close
   this issue. Thanks.
 *  [hleander](https://wordpress.org/support/users/hleander/)
 * (@hleander)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-3/#post-6462082)
 * I added this update and now I get a blank reCaptcha screen when inside Contact
   form 7.
 * I have verified that the reCaptcha Keys are correct from Google and all there
   area’s that required the key set.
 * Any Idea’s??
 * Hank Leander
 *  [hleander](https://wordpress.org/support/users/hleander/)
 * (@hleander)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-3/#post-6462083)
 * Just so you know for certain. I went through all the steps above prior to trying
   your beta update as I was also experiencing these issues after the plugin and
   wordpress updates.
 * One other item to note is that I am running PHP version 5.3 as recommended. I
   did try PHP 5.4 with the same results.
 * Any and all help will be GREATLY appreciated
 * Hank Leander

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-3/page/2/?output_format=md&replies=1)
[→](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-3/page/2/?output_format=md&replies=1)

The topic ‘syntax error, unexpected T_FUNCTION, PHP 5.4.43’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/bwp-recaptcha.svg)
 * [Better WordPress reCAPTCHA (with no CAPTCHA reCAPTCHA)](https://wordpress.org/plugins/bwp-recaptcha/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/bwp-recaptcha/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/bwp-recaptcha/)
 * [Active Topics](https://wordpress.org/support/plugin/bwp-recaptcha/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bwp-recaptcha/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bwp-recaptcha/reviews/)

 * 18 replies
 * 6 participants
 * Last reply from: [hleander](https://wordpress.org/support/users/hleander/)
 * Last activity: [10 years, 7 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-3/page/2/#post-6462086)
 * Status: resolved