ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Parse error?

November 13, 2007 8:29am

Subscribe [3]
  • #16 / Nov 13, 2007 10:53am

    mickfealty

    115 posts

    Okay. Now, I’m just getting a blank screen.

  • #17 / Nov 13, 2007 10:55am

    Robin Sowell

    13255 posts

    You used the right index.php files- for sure?  There’s one on the top level and another one inside your system folder.  I’d upload one of each from 1.6.1 just to be sure.  They should at least produce an error.  And if you flip back in and use the old one that we renamed with the _bk- you still get the error message.  Correct?

  • #18 / Nov 13, 2007 10:59am

    mickfealty

    115 posts

    Yo!!! It’s back!!!

  • #19 / Nov 13, 2007 11:08am

    Robin Sowell

    13255 posts

    Woot!  And you’re on the latest version.  Life is good- glad you got it squared away.

  • #20 / Nov 13, 2007 5:07pm

    mickfealty

    115 posts

    Parse error is back again…

    Adds: I’ve reloaded a blank index file and it has temporarily fixed it, but I suspect it won’t last…

  • #21 / Nov 13, 2007 5:08pm

    Derek Jones

    7561 posts

    Mick, with FTP, can you open the index.php file, and copy and paste its full contents here, please?

  • #22 / Nov 13, 2007 5:24pm

    mickfealty

    115 posts

    I don’t have an application that will allow me to open it. I have FileZilla, but nothing else…

  • #23 / Nov 13, 2007 5:26pm

    Derek Jones

    7561 posts

    You can open it with Notepad if you are on Windows, or with TextEdit if you are on Mac.  Copy it to your Desktop with your FTP application, and then use one of those two application’s File menu to Open it.

  • #24 / Nov 13, 2007 5:57pm

    mickfealty

    115 posts

    Aha… here you go…

    ?php
    /*
    =====================================================
     ExpressionEngine - by EllisLab
    -----------------------------------------------------
     <a href="http://expressionengine.com/">http://expressionengine.com/</a>
    -----------------------------------------------------
     Copyright (c) 2003 - 2007 EllisLab, Inc.
    =====================================================
     THIS IS COPYRIGHTED SOFTWARE
     PLEASE READ THE LICENSE AGREEMENT
     <a href="http://expressionengine.com/docs/license.html">http://expressionengine.com/docs/license.html</a>
    =====================================================
     File: index.php
    -----------------------------------------------------
     Purpose: Triggers the main engine
    =====================================================
    */
    
    // URI Type
    // This variable allows you to hard-code the URI type.
    // For most servers, 0 works fine.
    // 0 = auto  
    // 1 = path_info  
    // 2 = query_string
    
    $qtype = 0; 
    
    
    // DO NOT EDIT BELOW THIS!!! 
    
    error_reporting(0);
    
    if (isset($_GET['URL'])) 
    { 
        /** ---------------------------------
        /**  URL Redirect for CP and Links in Comments
        /** ---------------------------------*/
    
        $_GET['URL'] = str_replace(array("\r", "\r\n", "\n", ':',':','/','/'), 
                                   array('', '', '', ':', ':', '/', '/'), 
                                   $_GET['URL']);
        
        if (substr($_GET['URL'], 0, 4) != "http" AND ! ereg('://', $_GET['URL'])) 
            $_GET['URL'] = "http://".$_GET['URL']; 
            
        $_GET['URL'] = str_replace( array('"', "'", ')', '(', ';', '}', '{', 'script%', 'script&', '(', ')'), 
                                    '', 
                                    strip_tags($_GET['URL']));
        
        $host = ( ! isset($_SERVER['HTTP_HOST'])) ? '' : (substr($_SERVER['HTTP_HOST'],0,4) == 'www.' ? substr($_SERVER['HTTP_HOST'], 4) : $_SERVER['HTTP_HOST']);
        
        if ( ! isset($_SERVER['HTTP_REFERER']) OR ! stristr($_SERVER['HTTP_REFERER'], $host))
        {
            // Possibly not from our site, so we give the user the option
            // Of clicking the link or not
            
            $str = "<html>\n<head>\n<title>Redirect</title>\n</head>\n<body>".
                    "To proceed to the URL you have requested, click the link below:".
                    "<a href="http://.$_GET">".$_GET['URL']."</a>\n</body>\n</html>";
        }
        else
        {
            $str = "<html>\n<head>\n<title>Redirect</title>\n".
                   '<meta http-equiv="refresh" content="0; URL='.$_GET['URL'].'">'.
                   "\n</head>\n<body>\n</body>\n</html>";
        }
        
        exit($str);
    }
    
    $uri  = '';
    $pathinfo = pathinfo(__FILE__);
    $ext  = ( ! isset($pathinfo['extension'])) ? '.php' : '.'.$pathinfo['extension'];
    $self = ( ! isset($pathinfo['basename'])) ? 'index'.$ext : $pathinfo['basename'];
    
    $path_info = (isset($_SERVER['PATH_INFO'])) ? $_SERVER['PATH_INFO'] : @getenv('PATH_INFO');
    $query_str = (isset($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : @getenv('QUERY_STRING');
    
    switch ($qtype)
    {
        case 0 :    $uri = ($path_info != '' AND $path_info != "/".$self) ? $path_info : $query_str;
            break;
        case 1 :    $uri = $path_info;     
            break;
        case 2 :    $uri = $query_str; 
            break;
    }
    
    unset($system_path);
    unset($config_file);
    unset($path_info);
    unset($query_str);
    unset($qstr);
    
    require 'path'.$ext;
    
    if ((isset($template_group) AND isset($template)) && $uri != '' && $uri != '/')
    {
        $template_group = '';
        $template = '';
    }
    
    if ( ! isset($system_path))
    {
        if (file_exists('install'.$ext))
        {
            header("location: install".$ext); 
            exit;
        }
        else
        {
            exit("The system does not appear to be installed. Click <a href="http://install.php">here</a> to install it.");    
        }
    }
    
    if ( ! ereg("/$", $system_path)) $system_path .= '/';
    
    if ( ! @include($system_path.'core/core.system'.$ext))
    {
        exit("The system path does not appear to be set correctly.  Please open your path.php file and correct the path.");    
    }
    
    ?>
  • #25 / Nov 13, 2007 6:00pm

    Derek Jones

    7561 posts

    Did you just miss the opening ‘<’ when cutting and pasting, or does the file really start with “?php”.  And is the error and line number identical to what you first reported?  Go ahead and copy it verbatim again, please, just to be sure.

  • #26 / Nov 13, 2007 6:04pm

    mickfealty

    115 posts

    Resubmitting…

    <?php
    /*
    =====================================================
     ExpressionEngine - by EllisLab
    -----------------------------------------------------
     <a href="http://expressionengine.com/">http://expressionengine.com/</a>
    -----------------------------------------------------
     Copyright (c) 2003 - 2007 EllisLab, Inc.
    =====================================================
     THIS IS COPYRIGHTED SOFTWARE
     PLEASE READ THE LICENSE AGREEMENT
     <a href="http://expressionengine.com/docs/license.html">http://expressionengine.com/docs/license.html</a>
    =====================================================
     File: index.php
    -----------------------------------------------------
     Purpose: Triggers the main engine
    =====================================================
    */
    
    // URI Type
    // This variable allows you to hard-code the URI type.
    // For most servers, 0 works fine.
    // 0 = auto  
    // 1 = path_info  
    // 2 = query_string
    
    $qtype = 0; 
    
    
    // DO NOT EDIT BELOW THIS!!! 
    
    error_reporting(0);
    
    if (isset($_GET['URL'])) 
    { 
        /** ---------------------------------
        /**  URL Redirect for CP and Links in Comments
        /** ---------------------------------*/
    
        $_GET['URL'] = str_replace(array("\r", "\r\n", "\n", ':',':','/','/'), 
                                   array('', '', '', ':', ':', '/', '/'), 
                                   $_GET['URL']);
        
        if (substr($_GET['URL'], 0, 4) != "http" AND ! ereg('://', $_GET['URL'])) 
            $_GET['URL'] = "http://".$_GET['URL']; 
            
        $_GET['URL'] = str_replace( array('"', "'", ')', '(', ';', '}', '{', 'script%', 'script&', '(', ')'), 
                                    '', 
                                    strip_tags($_GET['URL']));
        
        $host = ( ! isset($_SERVER['HTTP_HOST'])) ? '' : (substr($_SERVER['HTTP_HOST'],0,4) == 'www.' ? substr($_SERVER['HTTP_HOST'], 4) : $_SERVER['HTTP_HOST']);
        
        if ( ! isset($_SERVER['HTTP_REFERER']) OR ! stristr($_SERVER['HTTP_REFERER'], $host))
        {
            // Possibly not from our site, so we give the user the option
            // Of clicking the link or not
            
            $str = "<html>\n<head>\n<title>Redirect</title>\n</head>\n<body>".
                    "To proceed to the URL you have requested, click the link below:".
                    "<a href="http://.$_GET">".$_GET['URL']."</a>\n</body>\n</html>";
        }
        else
        {
            $str = "<html>\n<head>\n<title>Redirect</title>\n".
                   '<meta http-equiv="refresh" content="0; URL='.$_GET['URL'].'">'.
                   "\n</head>\n<body>\n</body>\n</html>";
        }
        
        exit($str);
    }
    
    $uri  = '';
    $pathinfo = pathinfo(__FILE__);
    $ext  = ( ! isset($pathinfo['extension'])) ? '.php' : '.'.$pathinfo['extension'];
    $self = ( ! isset($pathinfo['basename'])) ? 'index'.$ext : $pathinfo['basename'];
    
    $path_info = (isset($_SERVER['PATH_INFO'])) ? $_SERVER['PATH_INFO'] : @getenv('PATH_INFO');
    $query_str = (isset($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : @getenv('QUERY_STRING');
    
    switch ($qtype)
    {
        case 0 :    $uri = ($path_info != '' AND $path_info != "/".$self) ? $path_info : $query_str;
            break;
        case 1 :    $uri = $path_info;     
            break;
        case 2 :    $uri = $query_str; 
            break;
    }
    
    unset($system_path);
    unset($config_file);
    unset($path_info);
    unset($query_str);
    unset($qstr);
    
    require 'path'.$ext;
    
    if ((isset($template_group) AND isset($template)) && $uri != '' && $uri != '/')
    {
        $template_group = '';
        $template = '';
    }
    
    if ( ! isset($system_path))
    {
        if (file_exists('install'.$ext))
        {
            header("location: install".$ext); 
            exit;
        }
        else
        {
            exit("The system does not appear to be installed. Click <a href="http://install.php">here</a> to install it.");    
        }
    }
    
    if ( ! ereg("/$", $system_path)) $system_path .= '/';
    
    if ( ! @include($system_path.'core/core.system'.$ext))
    {
        exit("The system path does not appear to be set correctly.  Please open your path.php file and correct the path.");    
    }
    
    ?>

    So far as I recall it was line 58 this time.

  • #27 / Nov 13, 2007 6:08pm

    Derek Jones

    7561 posts

    Can you copy and paste the error, Mick?

  • #28 / Nov 13, 2007 6:17pm

    mickfealty

    115 posts

    Sorry. I simply uploaded another new copy of the index file to get the site up and working again, and neglected to take a copy.

  • #29 / Nov 13, 2007 6:20pm

    Derek Jones

    7561 posts

    Ok, let me know if it occurs again, and cut and paste the error message here.  If it goes spontaneously from working to not working, there’s a concern that your file may be being corrupted, or even tampered with.

  • #30 / Nov 14, 2007 3:50am

    mickfealty

    115 posts

    Here it is:

    Parse error: syntax error, unexpected T_STRING in /home/slugger/public_html/index.php on line 58

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases