Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Yowww! header.php problem


Recommended Posts

I am in the proccess of setting up my site. I revamped the header.php file. The site works OK so far when browsing but after I log into the admin section I get various error messages(dending on what area I want to access). Example, when trying to enter the catalog from admin/inex.php I get Fatal error:main():failed opening required'includes/header.php'(include_path='.:/usr/local/lib/php') in */admin/configuration.php on line 45 so obviously I deleted something required. Here is my header.php file modified or new code is in red.




$Id: header.php,v 1.42 2003/06/10 18:20:38 hpdl Exp $


osCommerce, Open Source E-Commerce Solutions



Copyright © 2003 osCommerce


Released under the GNU General Public License



// check if the 'install' directory exists, and warn of its existence


if (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install')) {

$messageStack->add('header', WARNING_INSTALL_DIRECTORY_EXISTS, 'warning'); } } // check if the configure.php file is writeable if (WARN_CONFIG_WRITEABLE == 'true') { if ( (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) && (is_writeable(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) ) { $messageStack->add('header', WARNING_CONFIG_FILE_WRITEABLE, 'warning'); } } // check if the session folder is writeable if (WARN_SESSION_DIRECTORY_NOT_WRITEABLE == 'true') { if (STORE_SESSIONS == '') { if (!is_dir(tep_session_save_path())) { $messageStack->add('header', WARNING_SESSION_DIRECTORY_NON_EXISTENT, 'warning'); } elseif (!is_writeable(tep_session_save_path())) { $messageStack->add('header', WARNING_SESSION_DIRECTORY_NOT_WRITEABLE, 'warning'); } } } // check session.auto_start is disabled if ( (function_exists('ini_get')) && (WARN_SESSION_AUTO_START == 'true') ) { if (ini_get('session.auto_start') == '1') { $messageStack->add('header', WARNING_SESSION_AUTO_START, 'warning'); } } if ( (WARN_DOWNLOAD_DIRECTORY_NOT_READABLE == 'true') && (DOWNLOAD_ENABLED == 'true') ) { if (!is_dir(DIR_FS_DOWNLOAD)) { $messageStack->add('header', WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT, 'warning'); } } if ($messageStack->size('header') > 0) { echo $messageStack->output('header'); } ?>

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>


<TR class=header>

<TD align=middle><IMG src="/assets/banner_graphic3small.jpg"></TD></TR></TBODY></TABLE>

<TABLE cellSpacing=0 cellPadding=1 width="100%" border=0>


<TR class=headerNavigation>

<TD class=headerNavigation>??<A href="../../../index.html">home</A> </TD>

<TD class=headerNavigation align=right><?php if (tep_session_is_registered('customer_id')) { ?><A class=headerNavigation href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></A>?|? <?php } ?><A class=headerNavigation href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></A>?|? <A class=headerNavigation href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></A>?|? <A class=headerNavigation href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></A>??</TD></TR></TBODY></TABLE><?php

if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) {


<TABLE cellSpacing=0 cellPadding=2 width="100%" border=0>


<TR class=headerError>

<TD class=headerError><?php echo htmlspecialchars(urldecode($HTTP_GET_VARS['error_message'])); ?></TD></TR></TBODY></TABLE><?php



if (isset($HTTP_GET_VARS['info_message']) && tep_not_null($HTTP_GET_VARS['info_message'])) {


<TABLE cellSpacing=0 cellPadding=2 width="100%" border=0>


<TR class=headerInfo>

<TD class=headerInfo><?php echo htmlspecialchars($HTTP_GET_VARS['info_message']); ?></TD></TR></TBODY></TABLE><?php



Link to comment
Share on other sites

I should have included the entire error message when trying to access the catalog area instead of a partial error message. So here it is:


Warning: main(includes/header.php): failed to open stream: No such file or directory in /home/kenscust/public_html/osCommerce/catalog/admin/modules.php on line 79


Warning: main(includes/header.php): failed to open stream: No such file or directory in /home/kenscust/public_html/osCommerce/catalog/admin/modules.php on line 79


Fatal error: main(): Failed opening required 'includes/header.php' (include_path='.:/usr/local/lib/php') in /home/kenscust/public_html/osCommerce/catalog/admin/modules.php on line 79

Link to comment
Share on other sites

Hi all,


I hope you don't mind me honing in on your post, Ken2lsi, but I'm having a similar problem, and thought it better to address this here than to start a new one. If anyone out there is able to help, you may be able to solve two problems in one go... :-)


It's my first post, so if this is horribly bad posting etiquette, please accept my apology - but do let me know so I don't do it again!



That said:


My store problem is the same as above, with different errors. I have been busily altering the header and footer files, and all seemed to be going swimmingly in the catalog itself, but when I went to check my admin section, I was unable to access any of the pages and receive an error message when I attempt it. I've also got two errors at the bottom of the page on the main administration page.


The errors on the admin page read as follows:


Warning: require(includes/counter.php) [function.require]: failed to open stream: No such file or directory in /home/byfedor/public_html/catalog/admin/includes/footer.php on line 13


Fatal error: require() [function.require]: Failed opening required 'includes/counter.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/byfedor/public_html/catalog/admin/includes/footer.php on line 13


When attempting to access any of the sections, the error reads:



Fatal error: Call to undefined method messageStack::size() in /home/byfedor/public_html/catalog/admin/includes/header.php on line 51


I was surprised to get these errors since to my knowledge I hadn't altered anything on either of those lines.

After poking around in the files and not finding anything unusual (which doesn't actually mean that much, since I wouldn't know what usual was), I decided to reinstall the footer and header files. I assumed that this would solve the problem. Nothing. (Except that all my lovely layout changes where gone.)


Next, I reinstalled the counter.php file. Still nothing.


Very perplexed at this point...so I did what any self-respecting newbie would do..I scrapped the only other file I'd made extensive changes to - I reinstalled the stylesheet.


And guess what? Nothing. :-)


Any help would be very appreciated- I've been poking around in the forums for hours, and while I've found some incredibly useful posts, nothing thus far that relates to this problem (except of course this post)




Link to comment
Share on other sites

Hey Miram634,

Im still looking for the answer to this but Im getting close. If I find anything that I know will work I will come back here and post the answer for ya. All I have been able to figure out so far is that the tep_href_link or one of the other tep comands must be breaking the string when they are removed. Maybe something else is echoing back to this page for some data and its no longer there. But im still stabbin in the dark a little bit I will keep trying different stuff.

Link to comment
Share on other sites

Hi Ken2lsi,



That's great news!! I'd just about given up - I was gearing myself up for a complete reinstall. Ick. You can understand how appealing that idea is...


I'll keep plugging away too, but I suspect you may have more luck than me! Anything you can share would be fantastic.



Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...