1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

need urgent help for a Parse error in wp site.

Discussion in 'PHP' started by kaif0346, Jul 6, 2012.

  1. #1
    Hi,
    I am getting this error on my site :
    Parse error: syntax error, unexpected ';' in /home/amazinp/public_html/wp-settings.php on line 62


    here is my wp-settings.php file:
    <?php
    /**
     * Used to set up and fix common variables and include
     * the WordPress procedural and class library.
     *
     * Allows for some configuration in wp-config.php)
     *
     * @internal This file must be parsable by PHP4.
     *
     * @package WordPress
     */
    
    /**
     * Stores the location of the WordPress directory of functions, classes, and core content.
     *
     * @since 1.0.0
     */
    define( 'WPINC', 'wp-includes' );
    
    // Include files required for initialization.
    require( ABSPATH . WPINC . '/load.php' );
    require( ABSPATH . WPINC . '/default-constants.php' );
    require( ABSPATH . WPINC . '/version.php' );
    
    // Set initial default constants including WP_MEMORY_LIMIT, WP_MAX_MEMORY_LIMIT, WP_DEBUG, WP_CONTENT_DIR and WP_CACHE.
    wp_initial_constants( );
    
    // Check for the required PHP version and for the MySQL extension or a database drop-in.
    wp_check_php_mysql_versions();
    
    // Disable magic quotes at runtime. Magic quotes are added using wpdb later in wp-settings.php.
    @ini_set( 'magic_quotes_runtime', 0 );
    @ini_set( 'magic_quotes_sybase',  0 );
    
    // Set default timezone in PHP 5.
    if ( function_exists( 'date_default_timezone_set' ) )
    	date_default_timezone_set( 'UTC' );
    
    // Turn register_globals off.
    wp_unregister_GLOBALS();
    
    // Ensure these global variables do not exist so they do not interfere with WordPress.
    unset( $wp_filter, $cache_lastcommentmodified );
    
    // Standardize $_SERVER variables across setups.
    wp_fix_server_vars();
    
    // Check if we have received a request due to missing favicon.ico
    wp_favicon_request();
    
    // Check if we're in maintenance mode.
    wp_maintenance();
    
    // Start loading timer.
    timer_start();
    
    // Check if we're in WP_DEBUG mode.
    wp_debug_mode();
    
    // For an advanced caching plugin to use. Uses a static drop-in because you would only want one.
    if ( WP_CACHE )
    	WP_DEBUG ? include( WP_CONTENT_DIR . '/advanced-cache.php' );
    
    // Define WP_LANG_DIR if not set.
    wp_set_lang_dir();
    
    // Load early WordPress files.
    require( ABSPATH . WPINC . '/compat.php' );
    require( ABSPATH . WPINC . '/functions.php' );
    require( ABSPATH . WPINC . '/class-wp.php' );
    require( ABSPATH . WPINC . '/class-wp-error.php' );
    require( ABSPATH . WPINC . '/plugin.php' );
    
    // Include the wpdb class and, if present, a db.php database drop-in.
    require_wp_db();
    
    // Set the database table prefix and the format specifiers for database table columns.
    $GLOBALS['table_prefix'] = $table_prefix;
    wp_set_wpdb_vars();
    
    // Start the WordPress object cache, or an external object cache if the drop-in is present.
    wp_start_object_cache();
    
    // Load early WordPress files.
    require( ABSPATH . WPINC . '/default-filters.php' );
    require( ABSPATH . WPINC . '/pomo/mo.php' );
    
    // Initialize multisite if enabled.
    if ( is_multisite() ) {
    	require( ABSPATH . WPINC . '/ms-blogs.php' );
    	require( ABSPATH . WPINC . '/ms-settings.php' );
    } elseif ( ! defined( 'MULTISITE' ) ) {
    	define( 'MULTISITE', false );
    }
    
    register_shutdown_function( 'shutdown_action_hook' );
    
    // Stop most of WordPress from being loaded if we just want the basics.
    if ( SHORTINIT )
    	return false;
    
    // Load the l18n library.
    require( ABSPATH . WPINC . '/l10n.php' );
    
    // Run the installer if WordPress is not installed.
    wp_not_installed();
    
    
    // Load most of WordPress.
    require( ABSPATH . WPINC . '/class-wp-walker.php' );
    require( ABSPATH . WPINC . '/class-wp-ajax-response.php' );
    require( ABSPATH . WPINC . '/formatting.php' );
    require( ABSPATH . WPINC . '/capabilities.php' );
    require( ABSPATH . WPINC . '/query.php' );
    require( ABSPATH . WPINC . '/theme.php' );
    require( ABSPATH . WPINC . '/user.php' );
    require( ABSPATH . WPINC . '/meta.php' );
    require( ABSPATH . WPINC . '/general-template.php' );
    require( ABSPATH . WPINC . '/link-template.php' );
    require( ABSPATH . WPINC . '/author-template.php' );
    require( ABSPATH . WPINC . '/post.php' );
    require( ABSPATH . WPINC . '/post-template.php' );
    require( ABSPATH . WPINC . '/category.php' );
    require( ABSPATH . WPINC . '/category-template.php' );
    require( ABSPATH . WPINC . '/comment.php' );
    require( ABSPATH . WPINC . '/comment-template.php' );
    require( ABSPATH . WPINC . '/rewrite.php' );
    require( ABSPATH . WPINC . '/feed.php' );
    require( ABSPATH . WPINC . '/bookmark.php' );
    require( ABSPATH . WPINC . '/bookmark-template.php' );
    require( ABSPATH . WPINC . '/kses.php' );
    require( ABSPATH . WPINC . '/cron.php' );
    require( ABSPATH . WPINC . '/deprecated.php' );
    require( ABSPATH . WPINC . '/script-loader.php' );
    require( ABSPATH . WPINC . '/taxonomy.php' );
    require( ABSPATH . WPINC . '/update.php' );
    require( ABSPATH . WPINC . '/canonical.php' );
    require( ABSPATH . WPINC . '/shortcodes.php' );
    require( ABSPATH . WPINC . '/media.php' );
    require( ABSPATH . WPINC . '/http.php' );
    require( ABSPATH . WPINC . '/class-http.php' );
    require( ABSPATH . WPINC . '/widgets.php' );
    require( ABSPATH . WPINC . '/nav-menu.php' );
    require( ABSPATH . WPINC . '/nav-menu-template.php' );
    require( ABSPATH . WPINC . '/admin-bar.php' );
    
    // Load multisite-specific files.
    if ( is_multisite() ) {
    	require( ABSPATH . WPINC . '/ms-functions.php' );
    	require( ABSPATH . WPINC . '/ms-default-filters.php' );
    	require( ABSPATH . WPINC . '/ms-deprecated.php' );
    }
    
    // Define constants that rely on the API to obtain the default value.
    // Define must-use plugin directory constants, which may be overridden in the sunrise.php drop-in.
    wp_plugin_directory_constants( );
    
    // Load must-use plugins.
    foreach ( wp_get_mu_plugins() as $mu_plugin ) {
    	include_once( $mu_plugin );
    }
    unset( $mu_plugin );
    
    // Load network activated plugins.
    if ( is_multisite() ) {
    	foreach( wp_get_active_network_plugins() as $network_plugin ) {
    		include_once( $network_plugin );
    	}
    	unset( $network_plugin );
    }
    
    do_action( 'muplugins_loaded' );
    
    if ( is_multisite() )
    	ms_cookie_constants(  );
    
    // Define constants after multisite is loaded. Cookie-related constants may be overridden in ms_network_cookies().
    wp_cookie_constants( );
    
    // Define and enforce our SSL constants
    wp_ssl_constants( );
    
    // Create common globals.
    require( ABSPATH . WPINC . '/vars.php' );
    
    // Make taxonomies and posts available to plugins and themes.
    // @plugin authors: warning: these get registered again on the init hook.
    create_initial_taxonomies();
    create_initial_post_types();
    
    // Register the default theme directory root
    register_theme_directory( get_theme_root() );
    
    // Load active plugins.
    foreach ( wp_get_active_and_valid_plugins() as $plugin )
    	include_once( $plugin );
    unset( $plugin );
    
    // Load pluggable functions.
    require( ABSPATH . WPINC . '/pluggable.php' );
    require( ABSPATH . WPINC . '/pluggable-deprecated.php' );
    
    // Set internal encoding.
    wp_set_internal_encoding();
    
    // Run wp_cache_postload() if object cache is enabled and the function exists.
    if ( WP_CACHE && function_exists( 'wp_cache_postload' ) )
    	wp_cache_postload();
    
    do_action( 'plugins_loaded' );
    
    // Define constants which affect functionality if not already defined.
    wp_functionality_constants( );
    
    // Add magic quotes and set up $_REQUEST ( $_GET + $_POST )
    wp_magic_quotes();
    
    do_action( 'sanitize_comment_cookies' );
    
    /**
     * WordPress Query object
     * @global object $wp_the_query
     * @since 2.0.0
     */
    $wp_the_query = new WP_Query();
    
    /**
     * Holds the reference to @see $wp_the_query
     * Use this global for WordPress queries
     * @global object $wp_query
     * @since 1.5.0
     */
    $wp_query =& $wp_the_query;
    
    /**
     * Holds the WordPress Rewrite object for creating pretty URLs
     * @global object $wp_rewrite
     * @since 1.5.0
     */
    $wp_rewrite = new WP_Rewrite();
    
    /**
     * WordPress Object
     * @global object $wp
     * @since 2.0.0
     */
    $wp = new WP();
    
    /**
     * WordPress Widget Factory Object
     * @global object $wp_widget_factory
     * @since 2.8.0
     */
    $GLOBALS['wp_widget_factory'] = new WP_Widget_Factory();
    
    do_action( 'setup_theme' );
    
    // Define the template related constants.
    wp_templating_constants(  );
    
    // Load the default text localization domain.
    load_default_textdomain();
    
    // Find the blog locale.
    $locale = get_locale();
    $locale_file = WP_LANG_DIR . "/$locale.php";
    if ( ( 0 === validate_file( $locale ) ) && is_readable( $locale_file ) )
    	require( $locale_file );
    unset($locale_file);
    
    // Pull in locale data after loading text domain.
    require( ABSPATH . WPINC . '/locale.php' );
    
    /**
     * WordPress Locale object for loading locale domain date and various strings.
     * @global object $wp_locale
     * @since 2.1.0
     */
    $GLOBALS['wp_locale'] = new WP_Locale();
    
    // Load the functions for the active theme, for both parent and child theme if applicable.
    if ( ! defined( 'WP_INSTALLING' ) || 'wp-activate.php' === $pagenow ) {
    	if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists( STYLESHEETPATH . '/functions.php' ) )
    		include( STYLESHEETPATH . '/functions.php' );
    	if ( file_exists( TEMPLATEPATH . '/functions.php' ) )
    		include( TEMPLATEPATH . '/functions.php' );
    }
    
    do_action( 'after_setup_theme' );
    
    // Load any template functions the theme supports.
    require_if_theme_supports( 'post-thumbnails', ABSPATH . WPINC . '/post-thumbnail-template.php' );
    
    // Set up current user.
    $wp->init();
    
    /**
     * Most of WP is loaded at this stage, and the user is authenticated. WP continues
     * to load on the init hook that follows (e.g. widgets), and many plugins instantiate
     * themselves on it for all sorts of reasons (e.g. they need a user, a taxonomy, etc.).
     *
     * If you wish to plug an action once WP is loaded, use the wp_loaded hook below.
     */
    do_action( 'init' );
    
    // Check site status
    if ( is_multisite() ) {
    	if ( true !== ( $file = ms_site_check() ) ) {
    		require( $file );
    		die();
    	}
    	unset($file);
    }
    
    /**
     * This hook is fired once WP, all plugins, and the theme are fully loaded and instantiated.
     *
     * AJAX requests should use wp-admin/admin-ajax.php can handle requests for
     * users not logged in.
     *
     * @link http://codex.wordpress.org/AJAX_in_Plugins
     *
     * @since 3.0.0
     */
    do_action('wp_loaded');
    ?>
    
    Code (markup):
    someone Plz guide me. thanks in advance
     
    kaif0346, Jul 6, 2012 IP
  2. KristianI

    KristianI Greenhorn

    Messages:
    34
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    8
    #2
    Line 62


    change from this:

    WP_DEBUG ? include( WP_CONTENT_DIR . '/advanced-cache.php' );

    to this:

    WP_DEBUG ? include( WP_CONTENT_DIR . '/advanced-cache.php' ) : '';
     
    KristianI, Jul 6, 2012 IP
    kaif0346 likes this.
  3. kaif0346

    kaif0346 Member

    Messages:
    162
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    30
    #3
    after updating i got this error :

    Fatal error: Function name must be a string in /home/amazinp/public_html/wp-includes/load.php on line 110
     
    kaif0346, Jul 6, 2012 IP
  4. KristianI

    KristianI Greenhorn

    Messages:
    34
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    8
    #4
    What is on that line in load.php? And what version of wordpress are you using?
     
    KristianI, Jul 7, 2012 IP
  5. kaif0346

    kaif0346 Member

    Messages:
    162
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    30
    #5
    Sorry here is the load.php

    <?php
    /**
     * These functions are needed to load WordPress.
     *
     * @internal This file must be parsable by PHP4.
     *
     * @package WordPress
     */
    
    /**
     * Turn register globals off.
     *
     * @access private
     * @since 2.1.0
     * @return null Will return null if register_globals PHP directive was disabled
     */
    function wp_unregister_GLOBALS() {
    	if ( !ini_get( 'register_globals' ) )
    		return;
    
    	if ( isset( $_REQUEST['GLOBALS'] ) )
    		die( /*WP_I18N_GLOBALS_OVERWRITE*/'GLOBALS overwrite attempt detected'/*/WP_I18N_GLOBALS_OVERWRITE*/ );
    
    	// Variables that shouldn't be unset
    	$no_unset = array( 'GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES', 'table_prefix' );
    
    	$input = array_merge( $_GET, $_POST, $_COOKIE, $_SERVER, $_ENV, $_FILES, isset( $_SESSION ) && is_array( $_SESSION ) ? $_SESSION : array() );
    	foreach ( $input as $k => $v )
    		if ( !in_array( $k, $no_unset ) && isset( $GLOBALS[$k] ) ) {
    			$GLOBALS[$k] = null;
    			unset( $GLOBALS[$k] );
    		}
    }
    
    /**
     * Fix $_SERVER variables for various setups.
     *
     * @access private
     * @since 3.0.0
     */
    function wp_fix_server_vars() {
    	global $PHP_SELF;
    
    	$default_server_values = array(
    		'SERVER_SOFTWARE' => '',
    		'REQUEST_URI' => '',
    	);
    
    	$_SERVER = array_merge( $default_server_values, $_SERVER );
    
    	// Fix for IIS when running with PHP ISAPI
    	if ( empty( $_SERVER['REQUEST_URI'] ) || ( php_sapi_name() != 'cgi-fcgi' && preg_match( '/^Microsoft-IIS\//', $_SERVER['SERVER_SOFTWARE'] ) ) ) {
    
    		// IIS Mod-Rewrite
    		if ( isset( $_SERVER['HTTP_X_ORIGINAL_URL'] ) ) {
    			$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL'];
    		}
    		// IIS Isapi_Rewrite
    		else if ( isset( $_SERVER['HTTP_X_REWRITE_URL'] ) ) {
    			$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL'];
    		} else {
    			// Use ORIG_PATH_INFO if there is no PATH_INFO
    			if ( !isset( $_SERVER['PATH_INFO'] ) && isset( $_SERVER['ORIG_PATH_INFO'] ) )
    				$_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO'];
    
    			// Some IIS + PHP configurations puts the script-name in the path-info (No need to append it twice)
    			if ( isset( $_SERVER['PATH_INFO'] ) ) {
    				if ( $_SERVER['PATH_INFO'] == $_SERVER['SCRIPT_NAME'] )
    					$_SERVER['REQUEST_URI'] = $_SERVER['PATH_INFO'];
    				else
    					$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO'];
    			}
    
    			// Append the query string if it exists and isn't null
    			if ( ! empty( $_SERVER['QUERY_STRING'] ) ) {
    				$_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
    			}
    		}
    	}
    
    	// Fix for PHP as CGI hosts that set SCRIPT_FILENAME to something ending in php.cgi for all requests
    	if ( isset( $_SERVER['SCRIPT_FILENAME'] ) && ( strpos( $_SERVER['SCRIPT_FILENAME'], 'php.cgi' ) == strlen( $_SERVER['SCRIPT_FILENAME'] ) - 7 ) )
    		$_SERVER['SCRIPT_FILENAME'] = $_SERVER['PATH_TRANSLATED'];
    
    	// Fix for Dreamhost and other PHP as CGI hosts
    	if ( strpos( $_SERVER['SCRIPT_NAME'], 'php.cgi' ) !== false )
    		unset( $_SERVER['PATH_INFO'] );
    
    	// Fix empty PHP_SELF
    	$PHP_SELF = $_SERVER['PHP_SELF'];
    	if ( empty( $PHP_SELF ) )
    		$_SERVER['PHP_SELF'] = $PHP_SELF = preg_replace( '/(\?.*)?$/', '', $_SERVER["REQUEST_URI"] );
    }
    
    /**
     * Check for the required PHP version, and the MySQL extension or a database drop-in.
     *
     * Dies if requirements are not met.
     *
     * This function must be able to work without a complete environment set up. In wp-load.php, for
     * example, WP_CONTENT_DIR is defined and version.php is included before this function is called.
     *
     * @access private
     * @since 3.0.0
     */
    function wp_check_php_mysql_versions() {
    	// we can probably extend this function to check if wp_die() exists then use translated strings, and then use it in install.php etc.
    
    	global $required_php_version, $wp_version;
    	$phpversion();
    	if ( version_compare( $required_php_version, '>' ) )
    		die( sprintf( /*WP_I18N_OLD_PHP*/'Your server is running PHP version %1$s but WordPress %2$s requires at least %3$s.'/*/WP_I18N_OLD_PHP*/, $php_version ) );
    
    	if ( !extension_loaded( 'mysql' ) && !file_exists( WP_CONTENT_DIR . '/db.php' ) )
    		die( /*WP_I18N_OLD_MYSQL*/'Your PHP installation appears to be missing the MySQL extension which is required by WordPress.'/*/WP_I18N_OLD_MYSQL*/ );
    }
    
    /**
     * Don't load all of WordPress when handling a favicon.ico request.
     * Instead, send the headers for a zero-length favicon and bail.
     *
     * @since 3.0.0
     */
    function wp_favicon_request() {
    	if ( '/favicon.ico' == $_SERVER['REQUEST_URI'] ) {
    		header('Content-Type: image/vnd.microsoft.icon');
    		header('Content-Length: 0');
    		exit;
    	}
    }
    
    /**
     * Dies with a maintenance message when conditions are met.
     *
     * Checks for a file in the WordPress root directory named ".maintenance".
     * This file will contain the variable $upgrading, set to the time the file
     * was created. If the file was created less than 10 minutes ago, WordPress
     * enters maintenance mode and displays a message.
     *
     * The default message can be replaced by using a drop-in (maintenance.php in
     * the wp-content directory).
     *
     * @access private
     * @since 3.0.0
     */
    function wp_maintenance() {
    	if ( !file_exists( ABSPATH . '.maintenance' ) || defined( 'WP_INSTALLING' ) )
    		return;
    
    	global $upgrading;
    
    	include( ABSPATH . '.maintenance' );
    	// If the $upgrading timestamp is older than 10 minutes, don't die.
    	if ( ( time() - $upgrading ) >= 600 )
    		return;
    
    	if ( file_exists( WP_CONTENT_DIR . '/maintenance.php' ) ) {
    		require_once( WP_CONTENT_DIR . '/maintenance.php' );
    		die();
    	}
    
    	$protocol = $_SERVER["SERVER_PROTOCOL"];
    	if ( 'HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol )
    		$protocol = 'HTTP/1.0';
    	header( "$protocol 503 Service Unavailable", true, 503 );
    	header( 'Content-Type: text/html; charset=utf-8' );
    	header( 'Retry-After: 600' );
    ?>
    	<!DOCTYPE html>
    	<html xmlns="http://www.w3.org/1999/xhtml">
    	<head>
    	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    		<title><?php echo /*WP_I18N_MAINTENANCE*/'Maintenance'/*/WP_I18N_MAINTENANCE*/; ?></title>
    
    	</head>
    	<body>
    		<h1><?php echo /*WP_I18N_MAINT_MSG*/'Briefly unavailable for scheduled maintenance. Check back in a minute.'/*/WP_I18N_MAINT_MSG*/; ?></h1>
    	</body>
    	</html>
    <?php
    	die();
    }
    
    /**
     * PHP 4 standard microtime start capture.
     *
     * @access private
     * @since 0.71
     * @global int $timestart Seconds and microseconds added together from when function is called.
     * @return bool Always returns true.
     */
    function timer_start() {
    	global $timestart;
    	$mtime = explode( ' ', microtime() );
    	$timestart = $mtime[1] + $mtime[0];
    	return true;
    }
    
    /**
     * Return and/or display the time from the page start to when function is called.
     *
     * You can get the results and print them by doing:
     * <code>
     * $nTimePageTookToExecute = timer_stop();
     * echo $nTimePageTookToExecute;
     * </code>
     *
     * Or instead, you can do:
     * <code>
     * timer_stop(1);
     * </code>
     * which will do what the above does. If you need the result, you can assign it to a variable, but
     * in most cases, you only need to echo it.
     *
     * @since 0.71
     * @global int $timestart Seconds and microseconds added together from when timer_start() is called
     * @global int $timeend Seconds and microseconds added together from when function is called
     *
     * @param int $display Use '0' or null to not echo anything and 1 to echo the total time
     * @param int $precision The amount of digits from the right of the decimal to display. Default is 3.
     * @return float The "second.microsecond" finished time calculation
     */
    function timer_stop( $display = 0, $precision = 3 ) { // if called like timer_stop(1), will echo $timetotal
    	global $timestart, $timeend;
    	$mtime = microtime();
    	$mtime = explode( ' ', $mtime );
    	$timeend = $mtime[1] + $mtime[0];
    	$timetotal = $timeend - $timestart;
    	$r = ( function_exists( 'number_format_i18n' ) ) ? number_format_i18n( $timetotal, $precision ) : number_format( $timetotal, $precision );
    	if ( $display )
    		echo $r;
    	return $r;
    }
    
    /**
     * Sets PHP error handling and handles WordPress debug mode.
     *
     * Uses three constants: WP_DEBUG, WP_DEBUG_DISPLAY, and WP_DEBUG_LOG. All three can be
     * defined in wp-config.php. Example: <code> define( 'WP_DEBUG', true ); </code>
     *
     * WP_DEBUG_DISPLAY and WP_DEBUG_LOG perform no function unless WP_DEBUG is true.
     * WP_DEBUG defaults to false.
     *
     * When WP_DEBUG is true, all PHP notices are reported. WordPress will also display
     * notices, including one when a deprecated WordPress function, function argument,
     * or file is used. Deprecated code may be removed from a later version.
     *
     * It is strongly recommended that plugin and theme developers use WP_DEBUG in their
     * development environments.
     *
     * When WP_DEBUG_DISPLAY is true, WordPress will force errors to be displayed.
     * WP_DEBUG_DISPLAY defaults to true. Defining it as null prevents WordPress from
     * changing the global configuration setting. Defining WP_DEBUG_DISPLAY as false
     * will force errors to be hidden.
     *
     * When WP_DEBUG_LOG is true, errors will be logged to wp-content/debug.log.
     * WP_DEBUG_LOG defaults to false.
     *
     * @access private
     * @since 3.0.0
     */
    function wp_debug_mode() {
    	if ( WP_DEBUG ) {
    		// E_DEPRECATED is a core PHP constant in PHP 5.3. Don't define this yourself.
    		// The two statements are equivalent, just one is for 5.3+ and for less than 5.3.
    		if ( defined( 'E_DEPRECATED' ) )
    			error_reporting( E_ALL & ~E_DEPRECATED & ~E_STRICT );
    		else
    			error_reporting( E_ALL );
    
    		if ( WP_DEBUG_DISPLAY )
    			ini_set( 'display_errors', 1 );
    		elseif ( null !== WP_DEBUG_DISPLAY )
    			ini_set( 'display_errors', 0 );
    
    		if ( WP_DEBUG_LOG ) {
    			ini_set( 'log_errors', 1 );
    			ini_set( 'error_log', WP_CONTENT_DIR . '/debug.log' );
    		}
    	} else {
    		error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR );
    	}
    }
    
    /**
     * Sets the location of the language directory.
     *
     * To set directory manually, define <code>WP_LANG_DIR</code> in wp-config.php.
     *
     * If the language directory exists within WP_CONTENT_DIR, that is used.
     * Otherwise if the language directory exists within WPINC, that's used.
     * Finally, if neither of the preceding directories are found,
     * WP_CONTENT_DIR/languages is used.
     *
     * The WP_LANG_DIR constant was introduced in 2.1.0.
     *
     * @access private
     * @since 3.0.0
     */
    function wp_set_lang_dir() {
    	if ( !defined( 'WP_LANG_DIR' ) ) {
    		if ( file_exists( WP_CONTENT_DIR . '/languages' ) && @is_dir( WP_CONTENT_DIR . '/languages' ) || !@is_dir(ABSPATH . WPINC . '/languages') ) {
    			define( 'WP_LANG_DIR', WP_CONTENT_DIR . '/languages' ); // no leading slash, no trailing slash, full path, not relative to ABSPATH
    			if ( !defined( 'LANGDIR' ) ) {
    				// Old static relative path maintained for limited backwards compatibility - won't work in some cases
    				define( 'LANGDIR', 'wp-content/languages' );
    			}
    		} else {
    			define( 'WP_LANG_DIR', ABSPATH . WPINC . '/languages' ); // no leading slash, no trailing slash, full path, not relative to ABSPATH
    			if ( !defined( 'LANGDIR' ) ) {
    				// Old relative path maintained for backwards compatibility
    				define( 'LANGDIR', WPINC . '/languages' );
    			}
    		}
    	}
    }
    
    /**
     * Load the correct database class file.
     *
     * This function is used to load the database class file either at runtime or by
     * wp-admin/setup-config.php. We must globalize $wpdb to ensure that it is
     * defined globally by the inline code in wp-db.php.
     *
     * @since 2.5.0
     * @global $wpdb WordPress Database Object
     */
    function require_wp_db() {
    	global $wpdb;
    
    	require_once( ABSPATH . WPINC . '/wp-db.php' );
    	if ( file_exists( WP_CONTENT_DIR . '/db.php' ) )
    		require_once( WP_CONTENT_DIR . '/db.php' );
    
    	if ( isset( $wpdb ) )
    		return;
    
    	$wpdb = new wpdb( DB_USER, DB_PASSWORD, DB_NAME, DB_HOST );
    }
    
    /**
     * Sets the database table prefix and the format specifiers for database table columns.
     *
     * Columns not listed here default to %s.
     *
     * @see wpdb::$field_types Since 2.8.0
     * @see wpdb::prepare()
     * @see wpdb::insert()
     * @see wpdb::update()
     * @see wpdb::set_prefix()
     *
     * @access private
     * @since 3.0.0
     */
    function wp_set_wpdb_vars() {
    	global $wpdb, $table_prefix;
    	if ( !empty( $wpdb->error ) )
    		dead_db();
    
    	$wpdb->field_types = array( 'post_author' => '%d', 'post_parent' => '%d', 'menu_order' => '%d', 'term_id' => '%d', 'term_group' => '%d', 'term_taxonomy_id' => '%d',
    		'parent' => '%d', 'count' => '%d','object_id' => '%d', 'term_order' => '%d', 'ID' => '%d', 'commment_ID' => '%d', 'comment_post_ID' => '%d', 'comment_parent' => '%d',
    		'user_id' => '%d', 'link_id' => '%d', 'link_owner' => '%d', 'link_rating' => '%d', 'option_id' => '%d', 'blog_id' => '%d', 'meta_id' => '%d', 'post_id' => '%d',
    		'user_status' => '%d', 'umeta_id' => '%d', 'comment_karma' => '%d', 'comment_count' => '%d',
    		// multisite:
    		'active' => '%d', 'cat_id' => '%d', 'deleted' => '%d', 'lang_id' => '%d', 'mature' => '%d', 'public' => '%d', 'site_id' => '%d', 'spam' => '%d',
    	);
    
    	$prefix = $wpdb->set_prefix( $table_prefix );
    
    	if ( is_wp_error( $prefix ) )
    		wp_die( /*WP_I18N_BAD_PREFIX*/'<strong>ERROR</strong>: <code>$table_prefix</code> in <code>wp-config.php</code> can only contain numbers, letters, and underscores.'/*/WP_I18N_BAD_PREFIX*/ );
    }
    
    /**
     * Starts the WordPress object cache.
     *
     * If an object-cache.php file exists in the wp-content directory,
     * it uses that drop-in as an external object cache.
     *
     * @access private
     * @since 3.0.0
     */
    function wp_start_object_cache() {
    	global $_wp_using_ext_object_cache;
    
    	$first_init = false;
     	if ( ! function_exists( 'wp_cache_init' ) ) {
    		if ( file_exists( WP_CONTENT_DIR . '/object-cache.php' ) ) {
    			require_once ( WP_CONTENT_DIR . '/object-cache.php' );
    			$_wp_using_ext_object_cache = true;
    		} else {
    			require_once ( ABSPATH . WPINC . '/cache.php' );
    			$_wp_using_ext_object_cache = false;
    		}
    		$first_init = true;
    	} else if ( !$_wp_using_ext_object_cache && file_exists( WP_CONTENT_DIR . '/object-cache.php' ) ) {
    		// Sometimes advanced-cache.php before it is loaded here.
    		// This breaks the function_exists check above and can result in $_wp_using_ext_object_cache
    		// being set incorrectly. Double check if an external cache exists.
    		$_wp_using_ext_object_cache = true;
    	}
    
    	// If cache supports reset, reset instead of init if already initialized.
    	// Reset signals to the cache that global IDs have changed and it may need to update keys
    	// and cleanup caches.
    	if ( !$first_init && function_exists('wp_cache_reset') )
    		wp_cache_reset();
    	else
    		wp_cache_init();
    
    	if ( function_exists( 'wp_cache_add_global_groups' ) ) {
    		wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts' ) );
    		wp_cache_add_non_persistent_groups( array( 'comment', 'counts', 'plugins' ) );
    	}
    }
    
    /**
     * Redirects to the installer if WordPress is not installed.
     *
     * Dies with an error message when multisite is enabled.
     *
     * @access private
     * @since 3.0.0
     */
    function wp_not_installed() {
    	if ( is_multisite() ) {
    		if ( ! is_blog_installed() && ! defined( 'WP_INSTALLING' ) )
    			wp_die( __( 'The site you have requested is not installed properly. Please contact the system administrator.' ) );
    	} elseif ( ! is_blog_installed() && false === strpos( $_SERVER['PHP_SELF'], 'install.php' ) && !defined( 'WP_INSTALLING' ) ) {
    
    		$link = wp_guess_url() . '/wp-admin/install.php';
    
    		require( ABSPATH . WPINC . '/kses.php' );
    		require( ABSPATH . WPINC . '/pluggable.php' );
    		require( ABSPATH . WPINC . '/formatting.php' );
    		wp_redirect( $link );
    		die();
    	}
    }
    
    /**
     * Returns array of must-use plugin files to be included in global scope.
     *
     * The default directory is wp-content/mu-plugins. To change the default directory
     * manually, define <code>WPMU_PLUGIN_DIR</code> and <code>WPMU_PLUGIN_URL</code>
     * in wp-config.php.
     *
     * @access private
     * @since 3.0.0
     * @return array Files to include
     */
    function wp_get_mu_plugins() {
    	$mu_plugins = array();
    	if ( !is_dir( WPMU_PLUGIN_DIR ) )
    		return $mu_plugins;
    	if ( ! $dh = opendir( WPMU_PLUGIN_DIR ) )
    		return $mu_plugins;
    	while ( ( $plugin = readdir( $dh ) ) !== false ) {
    		if ( substr( $plugin, -4 ) == '.php' )
    			$mu_plugins[] = WPMU_PLUGIN_DIR . '/' . $plugin;
    	}
    	closedir( $dh );
    	sort( $mu_plugins );
    
    	return $mu_plugins;
    }
    
    /**
     * Returns array of plugin files to be included in global scope.
     *
     * The default directory is wp-content/plugins. To change the default directory
     * manually, define <code>WP_PLUGIN_DIR</code> and <code>WP_PLUGIN_URL</code>
     * in wp-config.php.
     *
     * @access private
     * @since 3.0.0
     * @return array Files to include
     */
    function wp_get_active_and_valid_plugins() {
    	$plugins = array();
    	$active_plugins = (array) get_option( 'active_plugins', array() );
    
    	// Check for hacks file if the option is enabled
    	if ( get_option( 'hack_file' ) && file_exists( ABSPATH . 'my-hacks.php' ) ) {
    		_deprecated_file( 'my-hacks.php', '1.5' );
    		array_unshift( $plugins, ABSPATH . 'my-hacks.php' );
    	}
    
    	if ( empty( $active_plugins ) || defined( 'WP_INSTALLING' ) )
    		return $plugins;
    
    	$network_plugins = is_multisite() ? wp_get_active_network_plugins() : false;
    
    	foreach ( $active_plugins as $plugin ) {
    		if ( ! validate_file( $plugin ) // $plugin must validate as file
    			&& '.php'
    			&& file_exists( WP_PLUGIN_DIR . '/' . $plugin ) // $plugin must exist
    			// not already included as a network plugin
    			&& ( ! $network_plugins || ! in_array( WP_PLUGIN_DIR . '/' . $plugin, $network_plugins ) )
    			)
    		$plugins[] = WP_PLUGIN_DIR . '/' . $plugin;
    	}
    	return $plugins;
    }
    
    /**
     * Sets internal encoding using mb_internal_encoding().
     *
     * In most cases the default internal encoding is latin1, which is of no use,
     * since we want to use the mb_ functions for utf-8 strings.
     *
     * @access private
     * @since 3.0.0
     */
    function wp_set_internal_encoding() {
    	if ( function_exists( 'mb_internal_encoding' ) ) {
    		if ( !@mb_internal_encoding( get_option( 'blog_charset' ) ) )
    			mb_internal_encoding( 'UTF-8' );
    	}
    }
    
    /**
     * Add magic quotes to $_GET, $_POST, $_COOKIE, and $_SERVER.
     *
     * Also forces $_REQUEST to be $_GET + $_POST. If $_SERVER, $_COOKIE,
     * or $_ENV are needed, use those superglobals directly.
     *
     * @access private
     * @since 3.0.0
     */
    function wp_magic_quotes() {
    	// If already slashed, strip.
    	if ( get_magic_quotes_gpc() ) {
    		$_GET    = stripslashes_deep( $_GET    );
    		$_POST   = stripslashes_deep( $_POST   );
    		$_COOKIE = stripslashes_deep( $_COOKIE );
    	}
    
    	// Escape with wpdb.
    	$_GET    = add_magic_quotes( $_GET    );
    	$_POST   = add_magic_quotes( $_POST   );
    	$_COOKIE = add_magic_quotes( $_COOKIE );
    	$_SERVER = add_magic_quotes( $_SERVER );
    
    	// Force REQUEST to be GET + POST.
    	$_REQUEST = array_merge( $_GET, $_POST );
    }
    
    /**
     * Runs just before PHP shuts down execution.
     *
     * @access private
     * @since 1.2.0
     */
    function shutdown_action_hook() {
    	do_action( 'shutdown' );
    	wp_cache_close();
    }
    
    /**
     * Copy an object.
     *
     * @since 2.7.0
     * @deprecated 3.2
     *
     * @param object $object The object to clone
     * @return object The cloned object
     */
    
    function wp_clone( $object ) {
    	// Use parens for clone to accommodate PHP 4.  See #17880
    	return clone( $object );
    }
    
    /**
     * Whether the current request is for a network or blog admin page
     *
     * Does not inform on whether the user is an admin! Use capability checks to
     * tell if the user should be accessing a section or not.
     *
     * @since 1.5.1
     *
     * @return bool True if inside WordPress administration pages.
     */
    function is_admin() {
    	if ( defined( 'WP_ADMIN' ) )
    		return WP_ADMIN;
    	return false;
    }
    
    /**
     * Whether the current request is for a blog admin screen /wp-admin/
     *
     * Does not inform on whether the user is a blog admin! Use capability checks to
     * tell if the user should be accessing a section or not.
     *
     * @since 3.1.0
     *
     * @return bool True if inside WordPress network administration pages.
     */
    function is_blog_admin() {
    	if ( defined( 'WP_BLOG_ADMIN' ) )
    		return WP_BLOG_ADMIN;
    	return false;
    }
    
    /**
     * Whether the current request is for a network admin screen /wp-admin/network/
     *
     * Does not inform on whether the user is a network admin! Use capability checks to
     * tell if the user should be accessing a section or not.
     *
     * @since 3.1.0
     *
     * @return bool True if inside WordPress network administration pages.
     */
    function is_network_admin() {
    	if ( defined( 'WP_NETWORK_ADMIN' ) )
    		return WP_NETWORK_ADMIN;
    	return false;
    }
    
    /**
     * Whether the current request is for a user admin screen /wp-admin/user/
     *
     * Does not inform on whether the user is an admin! Use capability checks to
     * tell if the user should be accessing a section or not.
     *
     * @since 3.1.0
     *
     * @return bool True if inside WordPress user administration pages.
     */
    function is_user_admin() {
    	if ( defined( 'WP_USER_ADMIN' ) )
    		return WP_USER_ADMIN;
    	return false;
    }
    
    /**
     * Whether Multisite support is enabled
     *
     * @since 3.0.0
     *
     * @return bool True if multisite is enabled, false otherwise.
     */
    function is_multisite() {
    	if ( defined( 'MULTISITE' ) )
    		return MULTISITE;
    
    	if ( defined( 'SUBDOMAIN_INSTALL' ) || defined( 'VHOST' ) || defined( 'SUNRISE' ) )
    		return true;
    
    	return false;
    }
    
    ?>
    
    Code (markup):
    Cant figure the version, how do I?
     
    kaif0346, Jul 7, 2012 IP
  6. KristianI

    KristianI Greenhorn

    Messages:
    34
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    8
    #6
    find line 110 where it says:

    $phpversion();

    and change it for this:

    $php_version = phpversion();
    and maybe you should change even the line after it to this:
    if ( version_compare( $required_php_version, $php_version, '>' ) )

    In administration on your dashboard there is a box with RIGHT NOW title, there you can see the version you are actually using. But I think if you are going to receive more errors, just upgrade to the newest version, because its weird that you have these errors.
     
    KristianI, Jul 7, 2012 IP
  7. kaif0346

    kaif0346 Member

    Messages:
    162
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    30
    #7
    wp-admin login page is also not opening this error:


    Warning: Unexpected character in input: ''' (ASCII=39) state=1 in /home/amazingp/public_html/wp-admin/index.php on line 105

    Parse error: syntax error, unexpected ')' in /home/amazingp/public_html/wp-admin/index.php on line 105
     
    kaif0346, Jul 7, 2012 IP
  8. KristianI

    KristianI Greenhorn

    Messages:
    34
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    8
    #8
    Then I would suggest to install a brand new site, rather than try to repair it file by file.
     
    KristianI, Jul 7, 2012 IP