Flourish PHP Unframework
This is an archived copy of the forum for reference purposes

fSession include error

posted by ihumanable 9 years ago

I'm trying to use fSession, in particular fSession::open() in some common init code. This works fine on my development server, as well as other dev, qa, and prod servers. I'm trying to deploy to a new host and I'm getting a rather cryptic error.

#!text/html
Parse error: syntax error, unexpected T_STRING in /lib/flourish/classes/fSession.php on line 668

The weird thing is that the version of fSession I'm deploying ends at line 668, from lines 648 to 668 is just the Copyright Notice comment. fSession is the first Flourish class that would be encountered and loaded, so I'm trying to figure out if this is some sort of isolated thing or if all Flourish classes will exhibit this error.

The target server I'm deploying to is running PHP version 5.2.13 on Linux. I can provide more details if needed.

Has anyone else run into this issue, could it be a newline incompatibility issue?

I presume you've checked to make sure the file isn't legitimately corrupted?

If the file looks fine in your editor, and the editor is set to UTF-8, I'm wondering if you are running some sort of op-code cache that could be corrupting things?

Does it work if you add a closing PHP tag at the end of the file?

posted by wbond 9 years ago

I did check to make sure that the file wasn't corrupted, my editor (TextMate) is set up for UTF-8 support. I've successfully built a bunch of sites with Flourish, it is the library that makes me love PHP again. This is the first time I've run into anything like this, I think it's something with the server config.

I will see if adding the php close tag fixes the problem and report back for history's sake.

Thanks for the idea Will.

posted by ihumanable 9 years ago

After banging my brain against this for a while I realized it was my error, somehow the fSession that I deployed ended up with the file contents repeated twice in the same file.

I'm not sure how this happened, but removing the duplicate class definition fixed everything up. Thanks for your help Will.

posted by ihumanable 9 years ago