aires Posted November 24, 2014 Share Posted November 24, 2014 Hello, I need help.Parse error: syntax error, unexpected 'SCRIPT_FILENAME' (T_STRING) in xxxxxxxxwp-content/themes/satish/thumb/timthumb.php on line 841Line 841 has this: $this->debug(3, "Generated docRoot using SCRIPT_FILENAME and PHP_SELF as: $docRoot"); How can i resolve this error? Quote Link to comment https://forums.phpfreaks.com/topic/292693-parse-error-syntax-error/ Share on other sites More sharing options...
davidannis Posted November 25, 2014 Share Posted November 25, 2014 Please post some context. Does the line before end in a ; Quote Link to comment https://forums.phpfreaks.com/topic/292693-parse-error-syntax-error/#findComment-1497568 Share on other sites More sharing options...
aires Posted November 25, 2014 Author Share Posted November 25, 2014 protected function calcDocRoot(){ $docRoot = @$_SERVER['DOCUMENT_ROOT']; if (defined('LOCAL_FILE_BASE_DIRECTORY')) { $docRoot = LOCAL_FILE_BASE_DIRECTORY; } if(!isset($docRoot)){ $this->debug(3, "DOCUMENT_ROOT is not set. This is probably windows. Starting search 1."); if(isset($_SERVER['SCRIPT_FILENAME'])){ $this->debug(3, "Generated docRoot using SCRIPT_FILENAME and PHP_SELF as: $docRoot"); } } if(!isset($docRoot)){ $this->debug(3, "DOCUMENT_ROOT still is not set. Starting search 2."); if(isset($_SERVER['PATH_TRANSLATED'])){ $docRoot = str_replace( '\', '/', substr(str_replace('\\', '\', $_SERVER['PATH_TRANSLATED']), 0, 0-strlen($_SERVER['PHP_SELF']))); $this->debug(3, "Generated docRoot using PATH_TRANSLATED and PHP_SELF as: $docRoot"); } Quote Link to comment https://forums.phpfreaks.com/topic/292693-parse-error-syntax-error/#findComment-1497569 Share on other sites More sharing options...
aires Posted November 25, 2014 Author Share Posted November 25, 2014 The full document is http://timthumb.googlecode.com/svn/trunk/timthumb.php Quote Link to comment https://forums.phpfreaks.com/topic/292693-parse-error-syntax-error/#findComment-1497570 Share on other sites More sharing options...
Ch0cu3r Posted November 25, 2014 Share Posted November 25, 2014 I do not get that error for that script you posted. Also that script you linked to is for a Wordpress theme. This is no longer maintained/supported as the original developer has expressed in their blog here I recommend you to find and use a different theme. 1 Quote Link to comment https://forums.phpfreaks.com/topic/292693-parse-error-syntax-error/#findComment-1497610 Share on other sites More sharing options...
bsmither Posted November 25, 2014 Share Posted November 25, 2014 Working on the irrational theory that, somehow, PHP is wanting to 'expand' the names of the constants in the quoted string, I would try this variation of the statement: $this->debug(3, 'Generated docRoot using SCRIPT_FILENAME and PHP_SELF as: '.$docRoot); using apostrophes to delineate the string, and concatenation. Quote Link to comment https://forums.phpfreaks.com/topic/292693-parse-error-syntax-error/#findComment-1497646 Share on other sites More sharing options...
Ch0cu3r Posted November 25, 2014 Share Posted November 25, 2014 @bsmiter Not true. Only variables are expanded within quotes Quote Link to comment https://forums.phpfreaks.com/topic/292693-parse-error-syntax-error/#findComment-1497653 Share on other sites More sharing options...
bsmither Posted November 27, 2014 Share Posted November 27, 2014 You could not duplicate the statement to get that error. I put on the table an irrational theory. When you remove the impossible, whatever remains, no matter how improbable, still must be tried. Quote Link to comment https://forums.phpfreaks.com/topic/292693-parse-error-syntax-error/#findComment-1497792 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.