1
Belle
problem : failed to open stream
  • 2004/8/30 6:25

  • Belle

  • Just popping in

  • Posts: 6

  • Since: 2004/8/27


i have just installed XOOPS on www.fluks.be

when i try to reach some module (e.g. forum) i get the error below

Warning: main(XOOPS_ROOT_PATH/class/xoopsblock.php): failed to open stream: No such file or directory in /usr/local/psa/home/vhosts/fluks.be/httpdocs/header.php on line 28

Warning: main(): Failed opening 'XOOPS_ROOT_PATH/class/xoopsblock.php' for inclusion (include_path='/usr/local/psa/home/vhosts/fluks.be/httpdocs:.') in /usr/local/psa/home/vhosts/fluks.be/httpdocs/header.php on line 28

Warning: main(XOOPS_ROOT_PATH/class/template.php): failed to open stream: No such file or directory in /usr/local/psa/home/vhosts/fluks.be/httpdocs/header.php on line 62

Fatal error: main(): Failed opening required 'XOOPS_ROOT_PATH/class/template.php' (include_path='/usr/local/psa/home/vhosts/fluks.be/httpdocs:.') in /usr/local/psa/home/vhosts/fluks.be/httpdocs/header.php on line 62



strange thing is that i only get the errors on some modules

http://www.fluks.be/modules/news/

works fine

http://www.fluks.be/modules/newbb/

gives an error

my header.php looks like this

<?php
// $Id: header.php,v 1.40 2004/06/13 05:47:31 Onokazu Exp $
// ------------------------------------------------------------------------ //
// XOOPS - PHP Content Management System //
// Copyright (c) 2000 XOOPS.org //
// <https://xoops.org/> //
// ------------------------------------------------------------------------ //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// //
// You may not change or alter any portion of this comment or credits //
// of supporting developers from this source code or any supporting //
// source code which is considered copyrighted (c) material of the //
// original comment or credit authors. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program; if not, write to the Free Software //
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
// ------------------------------------------------------------------------ //

include_once XOOPS_ROOT_PATH.'/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($criteria, true);
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();
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', $xoopsModule->getVar('name'));
if (preg_match("/index\.php$/i", xoops_getenv('PHP_SELF')) && $xoopsConfig['startpage'] == $xoopsModule->getVar('dirname')) {
$block_arr =& $xoopsblock->getAllByGroupModule($xoopsUser->getGroups(), $xoopsModule->getVar('mid'), true, XOOPS_BLOCK_VISIBLE);
} else {
$block_arr =& $xoopsblock->getAllByGroupModule($xoopsUser->getGroups(), $xoopsModule->getVar('mid'), false, XOOPS_BLOCK_VISIBLE);
}
} else {
$xoopsTpl->assign('xoops_pagetitle', htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES));
if (!empty($xoopsOption['show_cblock'])) {
$block_arr =& $xoopsblock->getAllByGroupModule($xoopsUser->getGroups(), 0, true, XOOPS_BLOCK_VISIBLE);
} else {
$block_arr =& $xoopsblock->getAllByGroupModule($xoopsUser->getGroups(), 0, false, XOOPS_BLOCK_VISIBLE);
}
}
} else {
$xoopsTpl->assign(array('xoops_isuser' => false, 'xoops_isadmin' => false));
if (isset($xoopsModule)) {
// set page title
$xoopsTpl->assign('xoops_pagetitle', $xoopsModule->getVar('name'));
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'), true, XOOPS_BLOCK_VISIBLE);
} else {
$block_arr =& $xoopsblock->getAllByGroupModule(XOOPS_GROUP_ANONYMOUS, $xoopsModule->getVar('mid'), false, XOOPS_BLOCK_VISIBLE);
}
} else {
$xoopsTpl->assign('xoops_pagetitle', htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES));
if (!empty($xoopsOption['show_cblock'])) {
$block_arr =& $xoopsblock->getAllByGroupModule(XOOPS_GROUP_ANONYMOUS, 0, true, XOOPS_BLOCK_VISIBLE);
} else {
$block_arr =& $xoopsblock->getAllByGroupModule(XOOPS_GROUP_ANONYMOUS, 0, false, XOOPS_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'] == 2 && $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();
}
}
?>

2
Belle
Re: problem : failed to open stream
  • 2004/8/31 6:33

  • Belle

  • Just popping in

  • Posts: 6

  • Since: 2004/8/27


can anyone help me

i tried loads of thing (reinstall, upgrade modules, etcetera)


3
Chappy
Re: problem : failed to open stream
  • 2004/8/31 7:20

  • Chappy

  • Friend of XOOPS

  • Posts: 456

  • Since: 2002/12/14


You probably need to give more information. You haven't said what version XOOPS you are installing, on what kind of server, etc.

How did the installation process go? Did you follow the XOOPS install process? How far did you get? DId you get any error messages along the way (xoops tries to tell you how things are going as the install process progresses). Can you get to the admin screen at this time?

You say Quote:
strange thing is that i only get the errors on some moduleshttp://www.fluks.be/modules/news/works fine


Were you able to add an article?

People here are pretty helpful. Just not sure where to start, I imagine...

4
Belle
Re: problem : failed to open stream
  • 2004/8/31 7:37

  • Belle

  • Just popping in

  • Posts: 6

  • Since: 2004/8/27


Quote:

Chappy wrote:
You probably need to give more information. You haven't said what version XOOPS you are installing, on what kind of server, etc.


version 2.07 (and upgraded to 2.071)

i can enter the admin, add articles, ...

you can view my header @

http://www.fluks.be/header.phps

mainfile @

http://www.fluks.be/mainfile.phps

mysql version is 3.238 or somethinh

5
Chappy
Re: problem : failed to open stream
  • 2004/8/31 8:22

  • Chappy

  • Friend of XOOPS

  • Posts: 456

  • Since: 2002/12/14


I got to get to bed, been up all night. No one should be able to see mainfile.php (Why is yours called mainfile.phps anyway? It should just be mainfile.php, I would imagine...) I trust that the page you linked to, mainfile.phps is just a edited version of your real one... You don't want anyone to see that page unless you've changed all the relevant information on the page that affects your site. I'd suggest you post one that looks something like yours but change paths, usernames, passwords, etc. We don't need to see that, know what I mean?? Worried about your security here... But, I'm sure that that does NOT reflect your real site info...

Were there any hiccups in the install process? The install process is so seamless with XOOPS that I cannot imagine that it would install some modules correctly and the others incorrectly. The forums are installed at the same time as the news module. My concern is that there was some part of the install process that was done manually.

6
Chappy
Re: problem : failed to open stream
  • 2004/9/1 2:47

  • Chappy

  • Friend of XOOPS

  • Posts: 456

  • Since: 2002/12/14


It looks like you've made some progress. That's good.

So I was taking a look at your error message. Have you looked in your /class directory to make sure that xoopsblock.php is there? Perhaps there was some error when you unpacked XOOPS or uploaded it. In any case, maybe make sure that that file is there.

That's the point of line 28 in header.php:
Quote:
include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php';


I think your error message, Quote:
Warning: main(XOOPS_ROOT_PATH/class/xoopsblock.php): failed to open stream: No such file or directory in /usr/local/psa/home/vhosts/fluks.be/httpdocs/header.php on line 28
, is saying that it cannot find that file in the expected place, or the name has been changed, or something like that.

But, given my skills in this stuff, I could be totally wrong. Still, it's probably worth looking.

Hope this helps!

7
Belle
Re: problem : failed to open stream
  • 2004/9/1 4:51

  • Belle

  • Just popping in

  • Posts: 6

  • Since: 2004/8/27


the file is there

http://www.fluks.be/class/xoopsblock.php

and so is

/class/template.php

i tried to upload the files again, but same problem

8
Chappy
Re: problem : failed to open stream
  • 2004/9/1 5:39

  • Chappy

  • Friend of XOOPS

  • Posts: 456

  • Since: 2002/12/14


Grasping at straws here since I'm not any kind of ph guru.

Possibilities:
1) In xoopsblock.php, are there any spaces before the <?php at the beginning of the file or after the ?> at the end of the file?
2) Take a look at this thread. It reinforces what I said at the beginning. There appears to be something goofy with the root path, or with it's being called in the forums. Why it would only be in particular modules, I have no idea. Did you go through the entire gui setup process when you installed xoops? It actually checks the root path during install. For whatever reason, the root path, at least in the forums, does not seem to be set right, or has become corrupted, which is the reason why it can't find that file, or template.php.

3) During install, did you have permissions set for mainfile.php to 777 as specified in the instructions? Perhaps it didn't write to/set up that file correctly if you didn't.

4) I found this link from our XOOPS friends over in Germany. After using Google to translate it, it seems clear that similar errors as yours have at their root, ahem, not having the correct root path - again why the file can't be found. One mention is made though that the provider had changed php versions over the course of the time that XOOPS was installed (if I understood the translation rightly). I still don't know why it works on the other mods though... Here's a similar post in French.

5) To help with these installation problems see the post here at the German site. It is translated into English in this link. It has a separate little file that you can use to check your paths. Or, you can just double-check them with your provider...

If you do a search on google with your errors (leaving out your paths, you can see that the error has been reported quite a bit.

Hope this helps. That's probably all I can do...

9
Belle
Re: problem : failed to open stream
  • 2004/9/1 6:02

  • Belle

  • Just popping in

  • Posts: 6

  • Since: 2004/8/27


first of all,thanx a lot for your help


Possibilities:
1) In xoopsblock.php, are there any spaces before the <?php at the beginning of the file or after the ?> at the end of the file?

---> no spaces

2) Take a look at this thread. It reinforces what I said at the beginning. There appears to be something goofy with the root path, or with it's being called in the forums. Why it would only be in particular modules, I have no idea. Did you go through the entire gui setup process when you installed xoops? It actually checks the root path during install. For whatever reason, the root path, at least in the forums, does not seem to be set right, or has become corrupted, which is the reason why it can't find that file, or template.php.

--> i did install XOOPS by the GUI and it said installation was ok

3) During install, did you have permissions set for mainfile.php to 777 as specified in the instructions? Perhaps it didn't write to/set up that file correctly if you didn't.

--> checked this also, if it isn't you can't install i believe (you get a red light)

4) I found this link from our XOOPS friends over in Germany. After using Google to translate it, it seems clear that similar errors as yours have at their root, ahem, not having the correct root path - again why the file can't be found. One mention is made though that the provider had changed php versions over the course of the time that XOOPS was installed (if I understood the translation rightly). I still don't know why it works on the other mods though... Here's a similar post in French.

--> i have installed and reinstalled several times

5) To help with these installation problems see the post here at the German site. It is translated into English in this link. It has a separate little file that you can use to check your paths. Or, you can just double-check them with your provider...


---> checked all the paths, there are the same as in the mainfile.php

10
Chappy
Re: problem : failed to open stream
  • 2004/9/1 6:48

  • Chappy

  • Friend of XOOPS

  • Posts: 456

  • Since: 2002/12/14


Final thought:

I notice that you said you were running 2.0.7 and that you then upgraded to 2.0.7.1 I also notice that the header.php file that you posted above has the following identification marks: Quote:
// $Id: header.php,v 1.40 2004/06/13 05:47:31 Onokazu Exp $
. But, the newest version, the one included in 2.0.7.1, was done by skalpa on 8/17 with the following identification information:
Quote:
// $Id: header.php,v 1.41 2004/08/17 03:29:51 skalpa Exp $
. In other words, even though the changes in the header.php file may not be relevant to the problem, there is a newer version than the one you posted in this thread. Which leads me to wonder if you don't have a couple of mixed version files in your setup? Perhaps one approach would be to download the full 2.0.7.1, delete all the files you currently have, and then do a completely fresh install. Pain in the butt, I know.

Sorry I haven't been more help...

Login

Who's Online

136 user(s) are online (66 user(s) are browsing Support Forums)


Members: 0


Guests: 136


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