MyBB Community Forums

Full Version: PHP CentOS Error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi All,

I have obtained Cohen's Dedicated server. Since obtaining it, I have gotten this error:

Quote:Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/bcousins/public_html/host4post.com/community/inc/class_error.php on line 51


This is caused by this function:

class errorHandler {

	/**
	 * Array of all of the error types
	 *
	 * @var array
	 */
	public $error_types = array(
		E_ERROR              => 'Error',
		E_WARNING            => 'Warning',
		E_PARSE              => 'Parsing Error',
		E_NOTICE             => 'Notice',
		E_CORE_ERROR         => 'Core Error',
		E_CORE_WARNING       => 'Core Warning',
		E_COMPILE_ERROR      => 'Compile Error',
		E_COMPILE_WARNING    => 'Compile Warning',
		E_DEPRECATED	     => 'Deprecated Warning',
		E_USER_ERROR         => 'User Error',
		E_USER_WARNING       => 'User Warning',
		E_USER_NOTICE        => 'User Notice',
		E_STRICT             => 'Runtime Notice',
		E_RECOVERABLE_ERROR  => 'Catchable Fatal Error',
		MYBB_SQL 			 => 'MyBB SQL Error', 
		MYBB_TEMPLATE		 => 'MyBB Template Error',
		MYBB_GENERAL		 => 'MyBB Error',
		MYBB_NOT_INSTALLED	 => 'MyBB Error',
		MYBB_NOT_UPGRADED 	 => 'MyBB Error',
		MYBB_INSTALL_DIR_EXISTS => 'MyBB Error',
		MYBB_SQL_LOAD_ERROR  => 'MyBB Error',
		MYBB_CACHE_NO_WRITE  => 'MyBB Error',
		MYBB_CACHEHANDLER_LOAD_ERROR => 'MyBB Error',
	);
	

Any help to fix this would be great.
What PHP version are you using?
You dont have an end brace at the end of your code "}"

Should be:

class errorHandler {

    /**
     * Array of all of the error types
     *
     * @var array
     */
    public $error_types = array(
        E_ERROR              => 'Error',
        E_WARNING            => 'Warning',
        E_PARSE              => 'Parsing Error',
        E_NOTICE             => 'Notice',
        E_CORE_ERROR         => 'Core Error',
        E_CORE_WARNING       => 'Core Warning',
        E_COMPILE_ERROR      => 'Compile Error',
        E_COMPILE_WARNING    => 'Compile Warning',
        E_DEPRECATED         => 'Deprecated Warning',
        E_USER_ERROR         => 'User Error',
        E_USER_WARNING       => 'User Warning',
        E_USER_NOTICE        => 'User Notice',
        E_STRICT             => 'Runtime Notice',
        E_RECOVERABLE_ERROR  => 'Catchable Fatal Error',
        MYBB_SQL              => 'MyBB SQL Error', 
        MYBB_TEMPLATE         => 'MyBB Template Error',
        MYBB_GENERAL         => 'MyBB Error',
        MYBB_NOT_INSTALLED     => 'MyBB Error',
        MYBB_NOT_UPGRADED      => 'MyBB Error',
        MYBB_INSTALL_DIR_EXISTS => 'MyBB Error',
        MYBB_SQL_LOAD_ERROR  => 'MyBB Error',
        MYBB_CACHE_NO_WRITE  => 'MyBB Error',
        MYBB_CACHEHANDLER_LOAD_ERROR => 'MyBB Error',
    ); 
}
(2012-07-10, 11:05 PM)Frank.Barry Wrote: [ -> ]You dont have an end brace at the end of your code "}"

Still the same problem

(2012-07-10, 11:02 PM)Known Wrote: [ -> ]What PHP version are you using?


5.3.13
Replace the class_error.php file with one from the default install?
STILL the same problem.
Then there is probably a problem of your PHP configuration, it looks like you are using PHP 4 and not 5.3.
That's precisely the problem.
Is this now solved then? If so, please mark it as solved.