3

I'm trying to run a WordPress plugin, and I get the following error:

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION
or T_FUNCTION or T_VAR or '}' in
/nfs/c03/h05/mnt/52704/domains/creathive.net/html/wp-content/plugins/qr-code-tag/lib/qrct/QrctWp.php
on line 13

What would cause this error? Line 13 is the public bit.

EDIT: Here is some code:

class QrctWp
{
    public $pluginName = 'QR Code Tag';
7
  • 4
    We need to see more code. There's going to be some sort of syntax error either before or after Line 13.
    – Mark Biek
    Jan 18, 2011 at 1:27
  • Yep to the above, that's the usual cause for the ol' unexpected T_STRING-er
    – jerluc
    Jan 18, 2011 at 1:29
  • I'm guessing a missing ; or an unclosed single or double-quote
    – Mark Biek
    Jan 18, 2011 at 1:32
  • That's not really enough code to go on.
    – Mark Biek
    Jan 18, 2011 at 1:36
  • 1
    The error is on line 13, but can be caused by something before line 13
    – dee-see
    Jan 18, 2011 at 1:40

1 Answer 1

13

Running on PHP4 by any chance? That's what the error message at this location would usually indicate.

Remove all public and private attributes. Though it's unlikely the plugin will work perfectly with the older object instance handling.

2
  • 1
    Yup just checked my htaccess file and it seems someone or something had removed the PHP5 handler.
    – Cameron
    Jan 18, 2011 at 1:52
  • This was helpful. I realized I was running PHP4 on an old server.
    – Mark
    Oct 4, 2016 at 20:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.