HTTP 500 on store page, log into admin just fine
Just finished upgrading from 1.5.5f to 1.5.7c, followed directions exactly as they are written in the upgrade post.
I can log into the admin just fine. Main store page (customer facing) will not load.
Error log states:
#1 require() called at [/home/andrewangelina/public_html/dragonqueenwinery.us/store_new/index.php:41]
--> PHP Warning: require(/home/andrewangelina/public_html/dragonqueenwinery.us/store_new/DIR_WS_INSTALL_TEMPLATEcommon/html_header.php): failed to open stream: No such file or directory in /home/andrewangelina/public_html/dragonqueenwinery.us/store_new/index.php on line 41.
Can anyone point me in the right direction?
Thanks,
Andrew
Re: HTTP 500 on store page, log into admin just fine
The original file has on line 41
and on line 42
PHP Code:
require($template->get_template_dir('html_header.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/html_header.php');
Compare the original file with the file on site. Probably a missing semicolon, comma, apostrophe or other typoin line 42 or higher up.
Start with line 42 and go up.
Re: HTTP 500 on store page, log into admin just fine
Certainly have something interesting going on. It would appear that there is software that is trying to perform an install; however, it does not have all of the defines in place to fully identify either the source or the destination installation path.
Some of this could be further assisted by completing the remaining questions associated with the posting tips...
Since you're able to access the admin, you might be able to use the tools->developers toolkit to search for where: DIR_WS_INSTALL_TEMPLATE is used. It may not be available as the entire word, but it should be something close to that. May have to remove the underscore and word TEMPLATE from the end in order to find matching text or some other variation, but the text provided is not standard for a vanilla Zen Cart install.
Re: HTTP 500 on store page, log into admin just fine
This is the original index.php file - unchanged:
<?php
/**
* index.php -- This is the main controller file for the Zen Cart installer
* @copyright Copyright 2003-2020 Zen Cart Development Team
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: Scott C Wilson 2019 Jul 16 Modified in v1.5.7 $
*/
// Actual version check is more strict; this is just to start the program
// For true minimum, see includes/systemChecks.yml under checkPhpVersionMin
if (PHP_VERSION_ID < 50500) {
die('Sorry, requires minimum PHP 5.5');
}
define('IS_ADMIN_FLAG',false);
/* Debugging
* 'silent': suppress all logging
* 'screen': display-to-screen and also to the /logs/ folder (synonyms: TRUE or 'TRUE' or 1)
* 'file': log-to-file-only (synonyms: anything other than above options)
*/
$debug_logging = 'file';
/*
* Ensure that the include_path can handle relative paths, before we try to load any files
*/
if (!strstr(ini_get('include_path'), '.')) ini_set('include_path', '.' . PATH_SEPARATOR . ini_get('include_path'));
/*
* Initialize system core components
*/
define('DIR_FS_INSTALL', __DIR__ . DIRECTORY_SEPARATOR);
define('DIR_FS_ROOT', dirname(__DIR__) . DIRECTORY_SEPARATOR);
require DIR_FS_INSTALL . 'includes/application_top.php';
if ($controller == 'cli') {
require DIR_FS_INSTALL . 'includes/cli_controller.php';
} else {
require DIR_FS_INSTALL . $page_directory . '/header_php.php';
require DIR_FS_INSTALL . DIR_WS_INSTALL_TEMPLATE . 'common/html_header.php';
require DIR_FS_INSTALL . DIR_WS_INSTALL_TEMPLATE . 'common/main_template_vars.php';
require DIR_FS_INSTALL . DIR_WS_INSTALL_TEMPLATE . 'common/tpl_main_page.php';
}
Re: HTTP 500 on store page, log into admin just fine
Quote:
Originally Posted by
mc12345678
Certainly have something interesting going on. It would appear that there is software that is trying to perform an install; however, it does not have all of the defines in place to fully identify either the source or the destination installation path.
Some of this could be further assisted by completing the remaining questions associated with the posting tips...
Since you're able to access the admin, you might be able to use the tools->developers toolkit to search for where: DIR_WS_INSTALL_TEMPLATE is used. It may not be available as the entire word, but it should be something close to that. May have to remove the underscore and word TEMPLATE from the end in order to find matching text or some other variation, but the text provided is not standard for a vanilla Zen Cart install.
Results of the search:
/home/andrewangelina/public_html/dragonqueenwinery.us/store_new/index.php
Line #41 : require DIR_FS_INSTALL . DIR_WS_INSTALL_TEMPLATE . 'common/html_header.php';
Line #42 : require DIR_FS_INSTALL . DIR_WS_INSTALL_TEMPLATE . 'common/main_template_vars.php';
Line #43 : require DIR_FS_INSTALL . DIR_WS_INSTALL_TEMPLATE . 'common/tpl_main_page.php';
Match Lines found: 3 --- Searching 1825 files ... for: DIR_WS_INSTALL_TEMPLATE
Re: HTTP 500 on store page, log into admin just fine
Quote:
Originally Posted by
bigandrew
Results of the search:
Code:
/home/andrewangelina/public_html/dragonqueenwinery.us/****/index.php
Line #41 : require DIR_FS_INSTALL . DIR_WS_INSTALL_TEMPLATE . 'common/html_header.php';
Line #42 : require DIR_FS_INSTALL . DIR_WS_INSTALL_TEMPLATE . 'common/main_template_vars.php';
Line #43 : require DIR_FS_INSTALL . DIR_WS_INSTALL_TEMPLATE . 'common/tpl_main_page.php';
Match Lines found: 3 --- Searching 1825 files ... for: DIR_WS_INSTALL_TEMPLATE
Somehow the index.php from zc_install got copied to here or the folder was renamed and somehow "incorporated"...
The file locations and content identified comes from the index.php file that is normally in the zc_install directory. Nothing from that directory is expected to be copied to the store's root. Those files are to be within the zc_install directory when used for upgrade then that folder is to be removed after successfully upgrading.
Re: HTTP 500 on store page, log into admin just fine
Quote:
Originally Posted by
mc12345678
Somehow the index.php from zc_install got copied to here or the folder was renamed and somehow "incorporated"...
The file locations and content identified comes from the index.php file that is normally in the zc_install directory. Nothing from that directory is expected to be copied to the store's root. Those files are to be within the zc_install directory when used for upgrade then that folder is to be removed after successfully upgrading.
Thinking about this some more makes me think that perhaps the previously posted index.php is from a different file location than described by your actual catalog's includes/configure.php and/or admin/includes/configure.php. Be sure to review the DIR_FS_CATALOG setting(s) as compared to where you ftp into... otherwise there may be something "more" going on with the site and/or server configuration...
Re: HTTP 500 on store page, log into admin just fine
Quote:
Originally Posted by
mc12345678
Thinking about this some more makes me think that perhaps the previously posted index.php is from a different file location than described by your actual catalog's includes/configure.php and/or admin/includes/configure.php. Be sure to review the DIR_FS_CATALOG setting(s) as compared to where you ftp into... otherwise there may be something "more" going on with the site and/or server configuration...
After re-installing this multiple times only to get the same error message, I thought why not replace this index.php file (v1.5.7c) with the one from my live site (1.5.5f). It worked, however, I'm not sure if this is the "right" way to fix the problem. Seems the coding in the 1.5.7 version is incorrect. I could be wrong.
Re: HTTP 500 on store page, log into admin just fine
Quote:
Originally Posted by
bigandrew
After re-installing this multiple times only to get the same error message, I thought why not replace this index.php file (v1.5.7c) with the one from my live site (1.5.5f). It worked, however, I'm not sure if this is the "right" way to fix the problem. Seems the coding in the 1.5.7 version is incorrect. I could be wrong.
Ummm.. The "differences" between the 1.5.7c and 1.5.5f catalog side index.php actually have no commonality to the issue that was described. There was something else that was wrong.
In fact the true differences between the catalog side index.php file for 1.5.5f compared to 1.5.7c is how the content of files is generated/processed. In the older version, the file's contents are generated as a potential array and then each element of the array is added onto the list of information. In the 1.5.7c version, basically the contents of the file were put together by taking an array and forcing it to a string. Again there was no `DIR_FS_INSTALL` nor `DIR_WS_INSTALL_TEMPLATE` in the expected catalog version of the index.php file.
The above differences would not have brought out the issue that was previously described.
1.5.5f:
Code:
foreach ($directory_array as $value) {
$onload_file = DIR_WS_MODULES . 'pages/' . $current_page_base . '/' . $value;
$read_contents='';
$lines = @file($onload_file);
foreach($lines as $line) {
$read_contents .= $line;
}
$za_onload_array[] = $read_contents;
}
1.5.7c:
Code:
foreach ($directory_array as $value) {
$onload_file = DIR_WS_MODULES . 'pages/' . $current_page_base . '/' . $value;
$read_contents='';
if ($lines = @file($onload_file)) {
$read_contents = implode('', $lines);
}
$za_onload_array[] = $read_contents;
}
1 Attachment(s)
Re: HTTP 500 on store page, log into admin just fine
Quote:
Originally Posted by
mc12345678
Ummm.. The "differences" between the 1.5.7c and 1.5.5f catalog side index.php actually have no commonality to the issue that was described. There was something else that was wrong.
In fact the true differences between the catalog side index.php file for 1.5.5f compared to 1.5.7c is how the content of files is generated/processed. In the older version, the file's contents are generated as a potential
array and then each element of the array is added onto the list of information. In the 1.5.7c version, basically the contents of the file were put together by taking an
array and forcing it to a string. Again there was no `DIR_FS_INSTALL` nor `DIR_WS_INSTALL_TEMPLATE` in the expected catalog version of the index.php file.
The above differences would not have brought out the issue that was previously described.
1.5.5f:
Code:
foreach ($directory_array as $value) {
$onload_file = DIR_WS_MODULES . 'pages/' . $current_page_base . '/' . $value;
$read_contents='';
$lines = @file($onload_file);
foreach($lines as $line) {
$read_contents .= $line;
}
$za_onload_array[] = $read_contents;
}
1.5.7c:
Code:
foreach ($directory_array as $value) {
$onload_file = DIR_WS_MODULES . 'pages/' . $current_page_base . '/' . $value;
$read_contents='';
if ($lines = @file($onload_file)) {
$read_contents = implode('', $lines);
}
$za_onload_array[] = $read_contents;
}
I re-downloaded the 1.5.7c zip file - and I'm not sure how this happened, but the index file is different than what I downloaded the other day. So long story short, whatever that index file was that I had in my original download (see attached) was indeed wrong. We are good now. Thanks for the help!