1
dtauto
failed to open stream: No such file or directory
  • 2004/8/16 14:13

  • dtauto

  • Just popping in

  • Posts: 56

  • Since: 2004/7/4 0


Greetings again, all. I've been absolutely problem-less since I've installed XOOPS but now, because of my hosting provider (GoDaddy.Com), I'm broke.

This started about three days ago:

Warningmain(XOOPS_ROOT_PATH/class/template.php): failed to open streamNo such file or directory in /home/content/t/h/e/thehype/html/header.php on line 75

Fatal error
main(): Failed opening required 'XOOPS_ROOT_PATH/class/template.php' (include_path='.:/usr/local/lib/php'in /home/content/t/h/e/thehype/html/header.php on line 75

Fatal error
Call to a member function on a non-object in /home/content/t/h/e/thehype/html/footer.php on line 30


I called GoDaddy.Com because I thought it odd that a hacker would usually leave some kind of 'message' behind, which meant that this crash wasn't hacker related. When I called GoDaddy.Com tech support, I was told that they recently had made a change to the server where I was hosted and although it was still a Linux server, it was now running a CGI API (whatever that means) but that it should still run my .php scripts.

This is the first time GoDaddy.Com has ever burnt me and so it is something I can overlook this once, but I'm a little lost on how to resolve this.

I've been through the search feature on this site as well as the wiki, and either I'm not searching right or I've missed it, but... I'm lost and desperately need help. I've already checked my permissions, so I know it's not going to be fixed through chmod.

You can see this page live @ http://www.deviant-tuning.com

Thanks in advance for any help!

2
dtauto
Re: failed to open stream: No such file or directory
  • 2004/8/16 17:43

  • dtauto

  • Just popping in

  • Posts: 56

  • Since: 2004/7/4 0


i know that line 75 of my header.php file refers to the path to template.php.

the top two errors go away by simple giving the full virtual path in line 75 as opposed to the <b>XOOPS_ROOT_DIR/header.php</b> that's there (or something like that), but then it generates a new error on line 76...

hmmm...

3
dtauto
Re: failed to open stream: No such file or directory
  • 2004/8/17 17:51

  • dtauto

  • Just popping in

  • Posts: 56

  • Since: 2004/7/4 0


any help on this would be awesome guys and i'd really appreciate it. my site has been done almost for an entire week and we're really amped to get it back up again.

thanks in advance.

4
jlm69
Re: failed to open stream: No such file or directory
  • 2004/8/17 18:05

  • jlm69

  • Module Developer

  • Posts: 719

  • Since: 2002/7/19


I'll try.

What version of XOOPS are you using?

in 2.06 and 2.07 this is line 75 of header.php

// prefix each tag with 'xoops_'

it is commented out.
Did you make any alterations to that file?

Maybe try to reupload just that file.

5
dtauto
Re: failed to open stream: No such file or directory
  • 2004/8/18 13:39

  • dtauto

  • Just popping in

  • Posts: 56

  • Since: 2004/7/4 0


my version is 2.0.7 and here's what line 75 is on header.php:

require_once XOOPS_ROOT_PATH.'/class/template.php';


actually, if it'll help, here's my entire header.php code...

include_once "http://www.deviant-tuning.com/class/xoopsblock.php";
if (
$xoopsConfig['theme_set'] != 'default' && file_exists(XOOPS_THEME_PATH.'/'.$xoopsConfig['theme_set'].'/theme.php')) {
    
// the old way..
    
$xoopsOption['theme_use_smarty'] = 0;
    if (
file_exists(XOOPS_THEME_PATH.'/'.$xoopsConfig['theme_set'].'/language/lang-'.$xoopsConfig['language'].'.php')) {
        include 
XOOPS_THEME_PATH.'/'.$xoopsConfig['theme_set'].'/language/lang-'.$xoopsConfig['language'].'.php';
    } elseif (
file_exists(XOOPS_THEME_PATH.'/'.$xoopsConfig['theme_set'].'/language/lang-english.php')) {
        include 
XOOPS_THEME_PATH.'/'.$xoopsConfig['theme_set'].'/language/lang-english.php';
    }
    
$config_handler =& xoops_gethandler('config');
    
$xoopsConfigMetaFooter =& $config_handler->getConfigsByCat(XOOPS_CONF_METAFOOTER);
    
xoops_header(false);
    include 
XOOPS_THEME_PATH.'/'.$xoopsConfig['theme_set'].'/theme.php';
    
$xoopsOption['show_rblock'] = (!empty($xoopsOption['show_rblock'])) ? $xoopsOption['show_rblock'] : 0;
    
// include Smarty template engine and initialize it
    
require_once XOOPS_ROOT_PATH.'/class/template.php';
    
$xoopsTpl = new XoopsTpl();
    if (
$xoopsConfig['debug_mode'] == 3) {
        
$xoopsTpl->xoops_setDebugging(true);
    }
    if (
$xoopsUser != '') {
        
$xoopsTpl->assign(array('xoops_isuser' => true'xoops_userid' => $xoopsUser->getVar('uid'), 'xoops_uname' => $xoopsUser->getVar('uname'), 'xoops_isadmin' => $xoopsUserIsAdmin));
    }
    
$xoopsTpl->assign('xoops_requesturi'htmlspecialchars($GLOBALS['xoopsRequestUri'], ENT_QUOTES));
    include 
XOOPS_ROOT_PATH.'/include/old_functions.php';
    
    if (
$xoopsOption['show_cblock'] || (isset($xoopsModule) && preg_match("/index.php$/i"xoops_getenv('PHP_SELF')) && $xoopsConfig['startpage'] == $xoopsModule->getVar('dirname'))) {
        
$xoopsOption['show_rblock'] = $xoopsOption['show_cblock'] = 1;
    }
    
themeheader($xoopsOption['show_rblock']);
    if (
$xoopsOption['show_cblock']) make_cblock();  //create center block
} else {
    
$xoopsOption['theme_use_smarty'] = 1;
    
// include Smarty template engine and initialize it
    
require_once XOOPS_ROOT_PATH.'/class/template.php';
    
$xoopsTpl = new XoopsTpl();
    
$xoopsTpl->xoops_setCaching(2);
    if (
$xoopsConfig['debug_mode'] == 3) {
        
$xoopsTpl->xoops_setDebugging(true);
    }
    
$xoopsTpl->assign(array('xoops_theme' => $xoopsConfig['theme_set'], 'xoops_imageurl' => XOOPS_THEME_URL.'/'.$xoopsConfig['theme_set'].'/''xoops_themecss'=> xoops_getcss($xoopsConfig['theme_set']), 'xoops_requesturi' => htmlspecialchars($GLOBALS['xoopsRequestUri'], ENT_QUOTES), 'xoops_sitename' => htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)));
    
// Meta tags
    
$config_handler =& xoops_gethandler('config');
    
$criteria = new CriteriaCompo(new Criteria('conf_modid'0));
    
$criteria->add(new Criteria('conf_catid'XOOPS_CONF_METAFOOTER));
    
$config =& $config_handler->getConfigs($criteriatrue);
    foreach (
array_keys($config) as $i) {
        
// prefix each tag with 'xoops_'
        
$xoopsTpl->assign('xoops_'.$config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
    }
    
//unset($config);
    // show banner?
    
if ($xoopsConfig['banners'] == 1) {
        
$xoopsTpl->assign('xoops_banner'xoops_getbanner());
    } else {
        
$xoopsTpl->assign('xoops_banner''&nbsp;');
    }
    
// Weird, but need extra <script> tags for 2.0.x themes
    
$xoopsTpl->assign('xoops_js''//--></script><script type="text/javascript" src="'.XOOPS_URL.'/include/xoops.js"></script><script type="text/javascript"><!--');
    
// get all blocks and assign to smarty
    
$xoopsblock = new XoopsBlock();
    
$block_arr = array();
    
//+----------------------------------------------
    //| PBBM Title status show we are browsing in 
    //| which forums/topics by Koudanshi        
    //+----------------------------------------------
    
if (!empty($xoopsModule)) 
        
$isWhere=$xoopsModule->getVar('name');
    else 
        
$isWhere="";
    
    if (
$isbb && preg_match("/pbboard/i"xoops_getenv('PHP_SELF'))) {
      
        
$fid=(!empty($HTTP_GET_VARS['f']))? $HTTP_GET_VARS['f'] : "";
        
$tid=(!empty($HTTP_GET_VARS['t']))? $HTTP_GET_VARS['t'] : "";
                   
        
$pbbm_qr=$xoopsDB->query("SELECT f.forum_name as fname, t.topic_title as tname FROM ".XOOPS_DB_PREFIX."_pbb_forums f, ".XOOPS_DB_PREFIX."_pbb_topics t WHERE f.forum_id='".$fid."' OR t.topic_id='".$tid."'");
        
$pbbm_ar=$xoopsDB->fetchArray($pbbm_qr);
        if (!empty(
$fid))
            
$isWhere.=" - ViewForum :: ".$pbbm_ar['fname'];
        elseif (!empty(
$tid))
            
$isWhere.=" - ".$pbbm_ar['fname']." :: ".$pbbm_ar['tname'];
        elseif (
preg_match("/faq/i"xoops_getenv('PHP_SELF')))
            
$isWhere.=" :: FAQ ";
        elseif (
preg_match("/groupcp/i"xoops_getenv('PHP_SELF')))            
            
$isWhere.=" :: Usergroup ";            
        elseif (
preg_match("/memberlist/i"xoops_getenv('PHP_SELF')))            
            
$isWhere.=" ::MemberList ";            
        elseif (
preg_match("/modcp/i"xoops_getenv('PHP_SELF')))            
            
$isWhere.=" :: Moderator Control panel ";            
        elseif (
preg_match("/posting/i"xoops_getenv('PHP_SELF')))            
            
$isWhere.=" :: Posting ";            
        elseif (
preg_match("/privmsg/i"xoops_getenv('PHP_SELF')))            
            
$isWhere.=" :: Private Messages ";            
        elseif (
preg_match("/profile/i"xoops_getenv('PHP_SELF')))            
            
$isWhere.=" :: Profile ";        
        elseif (
preg_match("/search/i"xoops_getenv('PHP_SELF')))            
            
$isWhere.=" :: Search ";        
        elseif (
preg_match("/viewonline/i"xoops_getenv('PHP_SELF')))            
            
$isWhere.=" :: Who online ";        
        else
            
$isWhere.=  " :: Index" ;
    }
    
//+----------------------------------------------        
    
    
if ($xoopsUser != '') {
        
$xoopsTpl->assign(array('xoops_isuser' => true'xoops_userid' => $xoopsUser->getVar('uid'), 'xoops_uname' => $xoopsUser->getVar('uname'), 'xoops_isadmin' => $xoopsUserIsAdmin));
        if (!empty(
$xoopsModule)) {
            
// set page title
            
$xoopsTpl->assign('xoops_pagetitle'$isWhere); // Koudanshi hack
            
if (preg_match("/index.php$/i"xoops_getenv('PHP_SELF')) && $xoopsConfig['startpage'] == $xoopsModule->getVar('dirname')) {
                
$block_arr =& $xoopsblock->getAllByGroupModule($xoopsUser->getGroups(), $xoopsModule->getVar('mid'), trueXOOPS_BLOCK_VISIBLE);
            } else {
                
$block_arr =& $xoopsblock->getAllByGroupModule($xoopsUser->getGroups(), $xoopsModule->getVar('mid'), falseXOOPS_BLOCK_VISIBLE);
            }
        } else {
            
$xoopsTpl->assign('xoops_pagetitle'htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES));
            if (!empty(
$xoopsOption['show_cblock'])) {
                
$block_arr =& $xoopsblock->getAllByGroupModule($xoopsUser->getGroups(), 0trueXOOPS_BLOCK_VISIBLE);
            } else {
                
$block_arr =& $xoopsblock->getAllByGroupModule($xoopsUser->getGroups(), 0falseXOOPS_BLOCK_VISIBLE);
            }
        }
    } else {
        
$xoopsTpl->assign(array('xoops_isuser' => false'xoops_isadmin' => false));
        if (isset(
$xoopsModule)) {
            
// set page title
            
$xoopsTpl->assign('xoops_pagetitle'$isWhere); // Koudanshi hack
            
if (preg_match("/index.php$/i"xoops_getenv('PHP_SELF')) && $xoopsConfig['startpage'] == $xoopsModule->getVar('dirname')) {
                
$block_arr =& $xoopsblock->getAllByGroupModule(XOOPS_GROUP_ANONYMOUS$xoopsModule->getVar('mid'), trueXOOPS_BLOCK_VISIBLE);
            } else {
                
$block_arr =& $xoopsblock->getAllByGroupModule(XOOPS_GROUP_ANONYMOUS$xoopsModule->getVar('mid'), falseXOOPS_BLOCK_VISIBLE);
            }
        } else {
            
$xoopsTpl->assign('xoops_pagetitle'htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES));
            if (!empty(
$xoopsOption['show_cblock'])) {
                
$block_arr =& $xoopsblock->getAllByGroupModule(XOOPS_GROUP_ANONYMOUS0trueXOOPS_BLOCK_VISIBLE);
            } else {
                
$block_arr =& $xoopsblock->getAllByGroupModule(XOOPS_GROUP_ANONYMOUS0falseXOOPS_BLOCK_VISIBLE);
            }
        }
    }
    foreach (
array_keys($block_arr) as $i) {
        
$bcachetime $block_arr[$i]->getVar('bcachetime');
        if (empty(
$bcachetime)) {
            
$xoopsTpl->xoops_setCaching(0);
        } else {
            
$xoopsTpl->xoops_setCaching(2);
            
$xoopsTpl->xoops_setCacheTime($bcachetime);
        }
        
$btpl $block_arr[$i]->getVar('template');
        if (
$btpl != '') {
            if (empty(
$bcachetime) || !$xoopsTpl->is_cached('db:'.$btpl)) {
                
$xoopsLogger->addBlock($block_arr[$i]->getVar('name'));
                
$bresult =& $block_arr[$i]->buildBlock();
                if (!
$bresult) {
                    continue;
                }
                
$xoopsTpl->assign_by_ref('block'$bresult);
                
$bcontent =& $xoopsTpl->fetch('db:'.$btpl);
                
$xoopsTpl->clear_assign('block');
            } else {
                
$xoopsLogger->addBlock($block_arr[$i]->getVar('name'), true$bcachetime);
                
$bcontent =& $xoopsTpl->fetch('db:'.$btpl);
            }
        } else {
            
$bid $block_arr[$i]->getVar('bid');
            if (empty(
$bcachetime) || !$xoopsTpl->is_cached('db:system_dummy.html''blk_'.$bid)) {
                
$xoopsLogger->addBlock($block_arr[$i]->getVar('name'));
                
$bresult =& $block_arr[$i]->buildBlock();
                if (!
$bresult) {
                    continue;
                }
                
$xoopsTpl->assign_by_ref('dummy_content'$bresult['content']);
                
$bcontent =& $xoopsTpl->fetch('db:system_dummy.html''blk_'.$bid);
                
$xoopsTpl->clear_assign('block');
            } else {
                
$xoopsLogger->addBlock($block_arr[$i]->getVar('name'), true$bcachetime);
                
$bcontent =& $xoopsTpl->fetch('db:system_dummy.html''blk_'.$bid);
            }
        }
        switch (
$block_arr[$i]->getVar('side')) {
        case 
XOOPS_SIDEBLOCK_LEFT:
            
$xoopsTpl->append('xoops_lblocks', array('title' => $block_arr[$i]->getVar('title'), 'content' => $bcontent));
            break;
        case 
XOOPS_CENTERBLOCK_LEFT:
            if (!isset(
$show_cblock)) {
                
$xoopsTpl->assign('xoops_showcblock'1);
                
$show_cblock 1;
            }
            
$xoopsTpl->append('xoops_clblocks', array('title' => $block_arr[$i]->getVar('title'), 'content' => $bcontent));
            break;
        case 
XOOPS_CENTERBLOCK_RIGHT:
            if (!isset(
$show_cblock)) {
                
$xoopsTpl->assign('xoops_showcblock'1);
                
$show_cblock 1;
            }
            
$xoopsTpl->append('xoops_crblocks', array('title' => $block_arr[$i]->getVar('title'), 'content' => $bcontent));
            break;
        case 
XOOPS_CENTERBLOCK_CENTER:
            if (!isset(
$show_cblock)) {
                
$xoopsTpl->assign('xoops_showcblock'1);
                
$show_cblock 1;
            }
            
$xoopsTpl->append('xoops_ccblocks', array('title' => $block_arr[$i]->getVar('title'), 'content' => $bcontent));
            break;
        case 
XOOPS_SIDEBLOCK_RIGHT:
            if (!isset(
$show_rblock)) {
                
$xoopsTpl->assign('xoops_showrblock'1);
                
$show_rblock 1;
            }
            
$xoopsTpl->append('xoops_rblocks', array('title' => $block_arr[$i]->getVar('title'), 'content' => $bcontent));
            break;
        }
        unset(
$bcontent);
    }
    
//unset($block_arr);
    
if (!isset($show_rblock)) {
        
$xoopsTpl->assign('xoops_showrblock'0);
    }
    if (!isset(
$show_cblock)) {
        
$xoopsTpl->assign('xoops_showcblock'0);
    }
    if (
xoops_getenv('REQUEST_METHOD') != 'POST' && !empty($xoopsModule) && !empty($xoopsConfig['module_cache'][$xoopsModule->getVar('mid')])) {
        
$xoopsTpl->xoops_setCaching(2);
        
$xoopsTpl->xoops_setCacheTime($xoopsConfig['module_cache'][$xoopsModule->getVar('mid')]);
        if (!isset(
$xoopsOption['template_main'])) {
            
$xoopsCachedTemplate 'db:system_dummy.html';
        } else {
            
$xoopsCachedTemplate 'db:'.$xoopsOption['template_main'];
        }
        
// generate safe cache Id
        
$xoopsCachedTemplateId 'mod_'.$xoopsModule->getVar('dirname').'|'.md5(str_replace(XOOPS_URL''$GLOBALS['xoopsRequestUri']));
        if (
$xoopsTpl->is_cached($xoopsCachedTemplate$xoopsCachedTemplateId)) {
            
$xoopsLogger->addExtra($xoopsCachedTemplate$xoopsConfig['module_cache'][$xoopsModule->getVar('mid')]);
            
$xoopsTpl->assign('xoops_contents'$xoopsTpl->fetch($xoopsCachedTemplate$xoopsCachedTemplateId));
            
$xoopsTpl->xoops_setCaching(0);
            if (!
headers_sent()) {
                
header ('Content-Type:text/html; charset='._CHARSET);
            }
            
$xoopsTpl->display($xoopsConfig['theme_set'].'/theme.html');
            if (
$xoopsConfig['debug_mode'] == && $xoopsUserIsAdmin) {
                
$dummyfile 'dummy_'.time().'.html';
                
$fp fopen(XOOPS_CACHE_PATH.'/'.$dummyfile'w');
                
fwrite($fp$xoopsLogger->dumpAll());
                
fclose($fp);
                echo 
'<script language=javascript>
                debug_window = openWithSelfMain("'
.XOOPS_URL.'/misc.php?action=showpopups&type=debug&file='.$dummyfile.'", "popup", 680, 450);
                </script>'
;
            }
            exit();
        }
    } else {
        
$xoopsTpl->xoops_setCaching(0);
    }
    if (!isset(
$xoopsOption['template_main'])) {
        
// new themes using Smarty does not have old functions that are required in old modules, so include them now
        
include XOOPS_ROOT_PATH.'/include/old_theme_functions.php';
        
// need this also
        
$xoopsTheme['thename'] = $xoopsConfig['theme_set'];
        
ob_start();
    }
}
?>


i know that's a lot to look at but you'll probably noticed a thing or two that i changed in an effort to get this stuff fixed. geez, i'm completely lost on this...

thanks for the reply jlm69!

6
tl
Re: failed to open stream: No such file or directory
  • 2004/8/18 15:08

  • tl

  • Friend of XOOPS

  • Posts: 999

  • Since: 2002/6/23


Not sure if you have already checked

1) class/template.php existing?
2) mainfile.php - physical path as /home/content/t/h/e/thehype/html ?

You may have to chmod template.php if both of items are okay,

7
dtauto
Re: failed to open stream: No such file or directory
  • 2004/8/18 16:28

  • dtauto

  • Just popping in

  • Posts: 56

  • Since: 2004/7/4 0


1) class/template.php is there
2) physical path is correct as /home/content/t/h/e/thehype/html

3) chmod template.php to read/write/execute for all (777), but still same errors...

8
dtauto
Re: failed to open stream: No such file or directory
  • 2004/8/19 21:34

  • dtauto

  • Just popping in

  • Posts: 56

  • Since: 2004/7/4 0


i called godaddy.com (my hosting provider and registrar) and asked them what they changed between last week and this week. they couldn't tell me. i asked if they could change anything back to its original config as it worked before, but they informed me that i could not. if anyone else out there is using godaddy, perhaps you could share what has happened in the last week that breaks xoops...

if there are any files that anyone would like me to display that might help you help me, please let me know. i'm very grateful for any help that anyone gives.

thank you in advance.

9
lstanley
Re: failed to open stream: No such file or directory
  • 2004/11/8 14:50

  • lstanley

  • Just popping in

  • Posts: 1

  • Since: 2003/12/4


I just had this same problem when copying my online version to my local laptop for a demo I am doing. To resolve this error, I edited mainfile.php. I edited:

define('XOOPS_ROOT_PATH', 'public_html');

to reflect the D:\<directoryname> on my local machine.

For your situation, it may be likely that GODaddy made a minor change to your home directory and that has affected your configuration file.

I realize your last post was quite some time ago, but hopefully this information will help someone else.

:) Lisa

Login

Who's Online

223 user(s) are online (160 user(s) are browsing Support Forums)


Members: 0


Guests: 223


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits