Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Setup Help


geolev

Recommended Posts

Posted

Hello everyone,

 

I am trying to setup my osCommerce cart locally for development and testing purposes. My actual site is up and running so I downloaded the entire site to my local machine. I changed a few things so it would point to my local MySQL database and the cart itself seems to work perfectly. I can see all my items and setup a customer without problem. I can put items into my shopping cart and even start the checkout process.

 

My problem is when I try to access the admin area, I get as far as the admin menu (the blue scree that lists Configuration, Catelog, Customers etc.) but when I click on any of the links on this page, I am directed to http://lists.gnu.org/archive/html/lynx-dev...4/msg00589.html. I can't figure out how this is happening. I search all of the code for 'msg00589.html' and it isn't mentioned anywhere.

 

For example, the Catelog link is pointing to:

http://localhostc/Program%20Files/Apache%2...a4334075aeba4f1

 

Why doesn't it go there?

 

My setup is:

Windows 2000 SP4

Apache 1.3.33 with PHP/4.3.9

MySql 3.23.53-max-nt

 

Has anybody run across this before?

 

Thanks,

 

George

George

Posted
post your admin configure.php file here

 

<?php
/*
 $Id: configuration.php,v 1.43 2003/06/29 22:50:51 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

 if (tep_not_null($action)) {
   switch ($action) {
     case 'save':
       $configuration_value = tep_db_prepare_input($HTTP_POST_VARS['configuration_value']);
       $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);

       tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . tep_db_input($configuration_value) . "', last_modified = now() where configuration_id = '" . (int)$cID . "'");

       tep_redirect(tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cID));
       break;
   }
 }

 $gID = (isset($HTTP_GET_VARS['gID'])) ? $HTTP_GET_VARS['gID'] : 1;

 $cfg_group_query = tep_db_query("select configuration_group_title from " . TABLE_CONFIGURATION_GROUP . " where configuration_group_id = '" . (int)$gID . "'");
 $cfg_group = tep_db_fetch_array($cfg_group_query);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script language="javascript" src="includes/general.js"></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
<!-- body_text //-->
   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><?php echo $cfg_group['configuration_group_title']; ?></td>
           <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr class="dataTableHeadingRow">
               <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CONFIGURATION_TITLE; ?></td>
               <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CONFIGURATION_VALUE; ?></td>
               <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>
             </tr>
<?php
 $configuration_query = tep_db_query("select configuration_id, configuration_title, configuration_value, use_function from " . TABLE_CONFIGURATION . " where configuration_group_id = '" . (int)$gID . "' order by sort_order");
 while ($configuration = tep_db_fetch_array($configuration_query)) {
   if (tep_not_null($configuration['use_function'])) {
     $use_function = $configuration['use_function'];
     if (ereg('->', $use_function)) {
       $class_method = explode('->', $use_function);
       if (!is_object(${$class_method[0]})) {
         include(DIR_WS_CLASSES . $class_method[0] . '.php');
         ${$class_method[0]} = new $class_method[0]();
       }
       $cfgValue = tep_call_function($class_method[1], $configuration['configuration_value'], ${$class_method[0]});
     } else {
       $cfgValue = tep_call_function($use_function, $configuration['configuration_value']);
     }
   } else {
     $cfgValue = $configuration['configuration_value'];
   }

   if ((!isset($HTTP_GET_VARS['cID']) || (isset($HTTP_GET_VARS['cID']) && ($HTTP_GET_VARS['cID'] == $configuration['configuration_id']))) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) {
     $cfg_extra_query = tep_db_query("select configuration_key, configuration_description, date_added, last_modified, use_function, set_function from " . TABLE_CONFIGURATION . " where configuration_id = '" . (int)$configuration['configuration_id'] . "'");
     $cfg_extra = tep_db_fetch_array($cfg_extra_query);

     $cInfo_array = array_merge($configuration, $cfg_extra);
     $cInfo = new objectInfo($cInfo_array);
   }

   if ( (isset($cInfo) && is_object($cInfo)) && ($configuration['configuration_id'] == $cInfo->configuration_id) ) {
     echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->configuration_id . '&action=edit') . '\'">' . "\n";
   } else {
     echo '                  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $configuration['configuration_id']) . '\'">' . "\n";
   }
?>
               <td class="dataTableContent"><?php echo $configuration['configuration_title']; ?></td>
               <td class="dataTableContent"><?php echo htmlspecialchars($cfgValue); ?></td>
               <td class="dataTableContent" align="right"><?php if ( (isset($cInfo) && is_object($cInfo)) && ($configuration['configuration_id'] == $cInfo->configuration_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $configuration['configuration_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>
             </tr>
<?php
 }
?>
           </table></td>
<?php
 $heading = array();
 $contents = array();

 switch ($action) {
   case 'edit':
     $heading[] = array('text' => '<b>' . $cInfo->configuration_title . '</b>');

     if ($cInfo->set_function) {
       eval('$value_field = ' . $cInfo->set_function . '"' . htmlspecialchars($cInfo->configuration_value) . '");');
     } else {
       $value_field = tep_draw_input_field('configuration_value', $cInfo->configuration_value);
     }

     $contents = array('form' => tep_draw_form('configuration', FILENAME_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->configuration_id . '&action=save'));
     $contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
     $contents[] = array('text' => '<br><b>' . $cInfo->configuration_title . '</b><br>' . $cInfo->configuration_description . '<br>' . $value_field);
     $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->configuration_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
     break;
   default:
     if (isset($cInfo) && is_object($cInfo)) {
       $heading[] = array('text' => '<b>' . $cInfo->configuration_title . '</b>');

       $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->configuration_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a>');
       $contents[] = array('text' => '<br>' . $cInfo->configuration_description);
       $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . tep_date_short($cInfo->date_added));
       if (tep_not_null($cInfo->last_modified)) $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED . ' ' . tep_date_short($cInfo->last_modified));
     }
     break;
 }

 if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
   echo '            <td width="25%" valign="top">' . "\n";

   $box = new box;
   echo $box->infoBox($heading, $contents);

   echo '            </td>' . "\n";
 }
?>
         </tr>
       </table></td>
     </tr>
   </table></td>
<!-- body_text_eof //-->
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

Thanks for the quick reply.

 

George

George

Posted

John actually meant configure.php and not configuration.php. I know they look similar. :thumbsup:

Posted
John actually meant configure.php and not configuration.php.  I know they look similar. :thumbsup:

 

Ah, yes, sorry. I missed that.

 

How about this one?

 

 

<?php
/*
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

// Define the webserver and path parameters
// * DIR_FS_* = Filesystem directories (local/physical)
// * DIR_WS_* = Webserver directories (virtual/URL)
//  define('HTTP_SERVER', 'http://pastichedesigns.com'); // eg, http://localhost - should not be empty for productive servers
 define('HTTP_SERVER', 'http://localhost'); // eg, http://localhost - should not be empty for productive servers
//  define('HTTP_CATALOG_SERVER', 'http://pastichedesigns.com');
 define('HTTP_CATALOG_SERVER', 'http://localhost');
//  define('HTTPS_CATALOG_SERVER', 'https://www.pastichedesigns.com');
 define('HTTPS_CATALOG_SERVER', 'http://localhost');
//  define('ENABLE_SSL_CATALOG', 'true'); // secure webserver for catalog module
 define('ENABLE_SSL_CATALOG', 'false'); // secure webserver for catalog module
//  define('DIR_FS_DOCUMENT_ROOT', '/home/pastic2/public_html/cart/'); // where the pages are located on the server
 define('DIR_FS_DOCUMENT_ROOT', 'C:/Program Files/Apache Group/Apache/htdocs/cart/'); // where the pages are located on the server
//  define('DIR_WS_ADMIN', '/cart/admin/'); // absolute path required
 define('DIR_WS_ADMIN', 'C:/Program Files/Apache Group/Apache/htdocs/cart/admin/'); // absolute path required
//  define('DIR_FS_ADMIN', '/home/pastic2/public_html/cart/admin/'); // absolute pate required
 define('DIR_FS_ADMIN', 'C:/Program Files/Apache Group/Apache/htdocs/cart/admin/'); // absolute pate required
//  define('DIR_WS_CATALOG', '/cart/'); // absolute path required
 define('DIR_WS_CATALOG', 'C:/Program Files/Apache Group/Apache/htdocs/cart/'); // absolute path required
//  define('DIR_FS_CATALOG', '/home/pastic2/public_html/cart/'); // absolute path required
 define('DIR_FS_CATALOG', 'C:/Program Files/Apache Group/Apache/htdocs/cart/'); // absolute path required
 define('DIR_WS_IMAGES', 'images/');
 define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
 define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/');
 define('DIR_WS_INCLUDES', 'includes/');
 define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
 define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
 define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
 define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
 define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
 define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG . 'includes/languages/');
 define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');
 define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');
 define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');
 define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');

// define our database connection
 define('DB_SERVER', 'localhost'); // eg, localhost - should not be empty for productive servers
 define('DB_SERVER_USERNAME', 'someusername');
 define('DB_SERVER_PASSWORD', '');
 define('DB_DATABASE', 'mydb');
 define('USE_PCONNECT', 'false'); // use persisstent connections?
 define('STORE_SESSIONS', 'mysql'); // leave empty '' for default handler or set to 'mysql'
?>

 

Thanks,

 

George

George

Posted

This configure.php file looks ok to me. Anybody else see anything wrong with it?

 

Damn strange how it redirects me to that LYNX-DEV forum. Weird. <_<

 

George

George

Posted

Here is a very low tech but very effective solution.

 

1. Backup your entire site.

 

2. Have a cup of coffee.

 

3. Delete your site (don't delete the backup).

 

4. Have a cup of tea (with milk and extra sugar).

 

5. Install a brand new osCommerce.

 

6. After the installation, fish out the 2 configure.php files.

 

7. Compare these 2 new configure.php with the ones in the backup.

 

*VERY IMPORTANT* You must follow step 2 and 4 to the letter. Otherwise the god of osCommerce will punish you. :thumbsup:

Posted
Here is a very low tech but very effective solution.

 

1. Backup your entire site.

 

2. Have a cup of coffee.

 

3. Delete your site (don't delete the backup).

 

4. Have a cup of tea (with milk and extra sugar).

 

5. Install a brand new osCommerce.

 

6. After the installation, fish out the 2 configure.php files.

 

7. Compare these 2 new configure.php with the ones in the backup.

 

*VERY IMPORTANT* You must follow step 2 and 4 to the letter.  Otherwise the god of osCommerce will punish you. :thumbsup:

 

Ok, but I can't do #2 or #4. I take my tea black or with Jack Daniel's. This is not negotiable. :D

 

 

The only difference between the two are the changes I made to get it running on my local machine. I did very similar changes to the cart configure.php file and it works perfectly:

 

I changed this...

  define('HTTP_SERVER', 'http://pastichedesigns.com'); // eg, http://localhost - should not be empty for productive servers
 define('HTTP_CATALOG_SERVER', 'http://pastichedesigns.com');
 define('HTTPS_CATALOG_SERVER', 'https://www.pastichedesigns.com');
 define('ENABLE_SSL_CATALOG', 'true'); // secure webserver for catalog module
 define('DIR_FS_DOCUMENT_ROOT', '/home/pastic2/public_html/cart/'); // where the pages are located on the server
 define('DIR_WS_ADMIN', '/cart/admin/'); // absolute path required
 define('DIR_FS_ADMIN', '/home/pastic2/public_html/cart/admin/'); // absolute pate required
 define('DIR_WS_CATALOG', '/cart/'); // absolute path required
 define('DIR_FS_CATALOG', '/home/pastic2/public_html/cart/'); // absolute path required

 

to this...

  define('HTTP_SERVER', 'http://localhost'); // eg, http://localhost - should not be empty for productive servers
 define('HTTP_CATALOG_SERVER', 'http://localhost');
 define('HTTPS_CATALOG_SERVER', '');
 define('ENABLE_SSL_CATALOG', 'false'); // secure webserver for catalog module
 define('DIR_FS_DOCUMENT_ROOT', 'C:/Program Files/Apache Group/Apache/htdocs/cart/'); // where the pages are located on the server
 define('DIR_WS_ADMIN', 'C:/Program Files/Apache Group/Apache/htdocs/cart/admin/'); // absolute path required
 define('DIR_FS_ADMIN', 'C:/Program Files/Apache Group/Apache/htdocs/cart/admin/'); // absolute pate required
 define('DIR_WS_CATALOG', 'C:/Program Files/Apache Group/Apache/htdocs/cart/'); // absolute path required
 define('DIR_FS_CATALOG', 'C:/Program Files/Apache Group/Apache/htdocs/cart/'); // absolute path required

 

I assume that "absolute path required" means I have to include the drive letter. I verified that all of these paths exist on my machine.

 

As I said in my original post, the cart actually works in my local environment and the deployed version of this same code, both the cart and the admin work fine on my live site (www.pastichedesigns.com). It is the admin in my local development environment that redirects me to the funky site when I click on any of the links on the admin page.

 

Is there a better way to set this up so that I can make changes and do testing without affecting my live site? How do other folks setup a test environment?

 

Thanks,

 

George

 

Now where did I put that Jack?

George

Posted
define('DIR_WS_ADMIN', '/cart/admin/');

 

define('DIR_WS_CATALOG', '/cart/');

 

Vger

 

:o Awsome. That worked! :D :D :D :D :D

I guess I should not've followed the advice of the comment. The comment that said "// absolute path required" was not valid.

Thanks so much. I don't understand it but it works.

 

George

George

Archived

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

×
×
  • Create New...