View Full Version : PHP Parse Error - search.php unexpected quote character
Im getting a PHP Parse error on the search.php line 3113
which is in the ParterStemmer class, and the following variable declaration:
private static $StemStopChars = "`1234567890-=\\;',./~!@#$%^&*_+|:\"<>?";
The specific error is: syntax error, unexpected '"'
When i just set the variable to blank, I no longer get the error and the search appears to work, but Im sure Im breaking something by doing that.
Im running PHP version 5.1.6. Im using latest zoom V6 beta7. Any ideas as to why Im getting this? Is it a php setting on my end or something?
I don't see anything wrong with that line.
Did you modify the source code? Or open the file up in a program besides Notepad or a respectable text editor? I can imagine that error happening if the "\" slash character was missing before the second last double-quote character on that line, but it's quite clearly there. Unless there's something odd happening and you're including the PHP file within another script, in a funny way or something. Please tell us if this is the case.
It might be worth re-indexing and re-uploading the files to make sure it's not caused by an accidental change to the file elsewhere.
We don't have PHP 5.1.6 sitting around here to test with. There's a small possibility it's a bug with PHP but I can't quite imagine it having a bug like that. I've just tested the script to run fine with PHP 5.2.6 and PHP 5.2.4.
I've confirmed that this must be an issue with my server/php configuration in how it treats static variables and quotes/double quotes - although I don't know how to fix it.
But, if I switch the variable declaration to use single quotes instead of double quotes, it will work for me.
So, incase others have this problem, I had to change the search.php to:
private static $StemStopChars = '`1234567890-=\\;\',./~!@#$%^&*_+|:"<>?';
note: the single quotes and escaping the single quote instead of the double quote inside the string.
Now, to figure out how to change server-side...
12-18-2008, 09:26 PM
Also as an update. Godaddy hosting seems to run PHP4 by default. Which also seems to provoke this problem. See this post for additional details (http://www.wrensoft.com/forum/showthread.php?p=11602) and a possible solution.
And we have updated the PHP script so that it doesn't get this error anymore on PHP5.
Powered by vBulletin® Version 4.1.12 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.