Originally Posted by
DrByte
Could try adding this to the top of zc_install/index.php after the call to application_top:
PHP Code:
if ($argc > 0) ...
Then try the command-line approach mentioned above.... just to get it to fully use the parameters properly
I added the snippet to index.php and then tried it from the command line from within the zc_install directory. Unfortunately, the result was not significantly different:
Code:
[email protected] [~/public_html]# cd catalog1302/zc_install
[email protected] [~/public_html/catalog1302/zc_install]# cat index.php
<?php
define('STRICT_ERROR_REPORTING',true);
/**
* index.php -- This is the main hub file for the Zen Cart installer *
* @package Installer
* @access private
* @copyright Copyright 2003-2006 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: index.php 3178 2006-03-12 22:30:49Z drbyte $
*/
define('IS_ADMIN_FLAG',false);
require('includes/application_top.php');
if ($argc > 0) {
for ($i=1;$i<$argc;$i++) {
$it = split("=",$argv[$i]);
$_GET[$it[0]] = $it[1];
// parse_str($argv[$i],$tmp);
// $_REQUEST = array_merge($_REQUEST, $tmp);
}
}
if (!isset($_GET['main_page']) || !zen_not_null($_GET['main_page'])) $_GET['main_page'] = 'index';
$current_page = $_GET['main_page'];
$page_directory = 'includes/modules/pages/' . $current_page;
$language_page_directory = 'includes/languages/' . $language . '/';
require('includes/languages/' . $language . '.php');
// init vars:
$zc_first_field = '';
// lang must be loaded before the header module
require('includes/languages/' . $language . '/' . $current_page . '.php');
require($page_directory . '/header_php.php');
require(DIR_WS_INSTALL_TEMPLATE . 'common/html_header.php');
require(DIR_WS_INSTALL_TEMPLATE . 'common/main_template_vars.php');
require(DIR_WS_INSTALL_TEMPLATE . 'common/tpl_main_page.php');
?>[email protected] [~/public_html/catalog1302/zc_install]# php index.php main_page=inspect > debuglog.txt
Segmentation fault
[email protected] [~/public_html/catalog1302/zc_install]# cat debuglog.txt
Content-type: text/html
X-Powered-By: PHP/4.4.0
<br />
<b>Notice</b>: Undefined index: HTTP_USER_AGENT in <b>/home/erbdevco/public_html/catalog1302/zc_install/includes/classes/installer.php</b> on line <b>18</b><br />
<br />
<b>Notice</b>: Undefined index: debug in <b>/home/erbdevco/public_html/catalog1302/zc_install/includes/modules/pages/inspect/header_php.php</b> on line <b>12</b><br />
<br />
<b>Notice</b>: Undefined index: debug2 in <b>/home/erbdevco/public_html/catalog1302/zc_install/includes/modules/pages/inspect/header_php.php</b> on line <b>13</b><br />
<br />
<b>Notice</b>: Undefined index: debug3 in <b>/home/erbdevco/public_html/catalog1302/zc_install/includes/modules/pages/inspect/header_php.php</b> on line <b>14</b><br />
[email protected] [~/public_html/catalog1302/zc_install]#
So not much change. I wasn't sure if it was getting the command-line arguments so I commented out the parsing snippet I had just added, hard-coded $current_page to be 'inspect', then echo'd it to stdout and tried it again at the command line as below:
Code:
[email protected] [~/public_html/catalog1302/zc_install]# cat index.php
<?php
define('STRICT_ERROR_REPORTING',true);
/**
* index.php -- This is the main hub file for the Zen Cart installer *
* @package Installer
* @access private
* @copyright Copyright 2003-2006 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: index.php 3178 2006-03-12 22:30:49Z drbyte $
*/
define('IS_ADMIN_FLAG',false);
require('includes/application_top.php');
// if ($argc > 0) {
// for ($i=1;$i<$argc;$i++) {
// $it = split("=",$argv[$i]);
// $_GET[$it[0]] = $it[1];
// // parse_str($argv[$i],$tmp);
// // $_REQUEST = array_merge($_REQUEST, $tmp);
// }
// }
if (!isset($_GET['main_page']) || !zen_not_null($_GET['main_page'])) $_GET['main_page'] = 'index';
$current_page = $_GET['main_page'];
$current_page = 'inspect'; // hard-wire to inspect for debug purposes only... SAR 060724
echo '<p>current_page = ',$current_page,'</p>'; // added for debug purposes only... SAR 060724
$page_directory = 'includes/modules/pages/' . $current_page;
$language_page_directory = 'includes/languages/' . $language . '/';
require('includes/languages/' . $language . '.php');
// init vars:
$zc_first_field = '';
// lang must be loaded before the header module
require('includes/languages/' . $language . '/' . $current_page . '.php');
require($page_directory . '/header_php.php');
require(DIR_WS_INSTALL_TEMPLATE . 'common/html_header.php');
require(DIR_WS_INSTALL_TEMPLATE . 'common/main_template_vars.php');
require(DIR_WS_INSTALL_TEMPLATE . 'common/tpl_main_page.php');
?>[email protected] [~/public_html/catalog1302/zc_install]# php index.php main_page=inspect > debuglog.txt
Segmentation fault
[email protected] [~/public_html/catalog1302/zc_install]# cat debuglog.txt
Content-type: text/html
X-Powered-By: PHP/4.4.0
<br />
<b>Notice</b>: Undefined index: HTTP_USER_AGENT in <b>/home/erbdevco/public_html/catalog1302/zc_install/includes/classes/installer.php</b> on line <b>18</b><br />
<p>current_page = inspect</p><br />
<b>Notice</b>: Undefined index: debug in <b>/home/erbdevco/public_html/catalog1302/zc_install/includes/modules/pages/inspect/header_php.php</b> on line <b>12</b><br />
<br />
<b>Notice</b>: Undefined index: debug2 in <b>/home/erbdevco/public_html/catalog1302/zc_install/includes/modules/pages/inspect/header_php.php</b> on line <b>13</b><br />
<br />
<b>Notice</b>: Undefined index: debug3 in <b>/home/erbdevco/public_html/catalog1302/zc_install/includes/modules/pages/inspect/header_php.php</b> on line <b>14</b><br />
[email protected] [~/public_html/catalog1302/zc_install]#
So other than verifying that $current_page was set to 'inspect', the output was the same.
I'm not sure what to try next.
Bookmarks