Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

OSC 2.2 Links do not work in Admin


duckydan

Recommended Posts

Hello.  I am helping a company upgrade their site.  We tried to upgrade to 2.3 but there are too many customizations and the pages will not work with the newest version so I'm trying to go step by step on my dev server and so far have only installed the "Register Globals Fix" so that we can use PHP 5.6 and try to get paypal working with the latest version.  (Right now we are whitelisted because of the fix)

 

I have the site working but my catalog links do not work and my links in the admin portal do not work.  I'm not sure why.  They work on the prod site and the only difference is the ip address in the URL versus the URL.  Can anyone think of anything else to check?  The admin settings are below (with the passwords removed obviously for security sake)

 

 

<?php
/*
  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com
  Copyright © 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://64.64.0.104/~bowhunte'); // eg, http://localhost - should not be empty for productive servers
  define('HTTP_CATALOG_SERVER', 'http://64.64.0.104/~bowhunte');
  define('ENABLE_SSL_CATALOG', 'true'); // secure webserver for catalog module
  define('DIR_FS_DOCUMENT_ROOT', '/home/bowhunte/public_html/'); // where the pages are located on the server
  define('DIR_WS_ADMIN', '/admin/'); // absolute path required
  define('DIR_FS_ADMIN', '/home/bowhunte/public_html/admin/'); // absolute pate required
  define('DIR_WS_CATALOG', '/'); // absolute path required
  define('DIR_FS_CATALOG', '/home/bowhunte/public_html/'); // 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', 'REMOVEDFORNOW');
  define('DB_SERVER_PASSWORD', 'REMOVEDFORNOW);
  define('DB_DATABASE', 'REMOVEDFORNOW');
  define('USE_PCONNECT', 'false'); // use persisstent connections?
  define('STORE_SESSIONS', 'mysql'); // leave empty '' for default handler or set to 'mysql'
?>

 

 

 

Link to comment
Share on other sites

I'm not sure but your DIR_FS_CATALOG is different than mine.

You can try - define('DIR_FS_CATALOG', DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG);


Not sure if these matter either.

Your define('ENABLE_SSL_CATALOG', 'true');  it set to true but you have it with the http protocol. - define('HTTP_SERVER', 'http://64.64.0.104/~bowhunte');
and your define('HTTPS_CATALOG_SERVER', ''); is missing from the file
and your define('DIR_WS_HTTPS_CATALOG', '/'); is missing from the file as well

Link to comment
Share on other sites

Thanks for the reply.  So both my admin file and my catalog links on the left are broken.  I fixed all of those items you mentioned.  It is populated but once I click on any link I get a 404 not found error. I found one post that said to clear the cache but I can't click on the clear cache link.  In the admin panel the "Catalog" and "Configuration" menus do nothing and the Vouchers / Coupons gives me a 404 but all other pages work.

​The site was backed up from the original server with a complete backup except for the PHP being upgraded and that one patch so unless the server team botched the migration i'm thinking something else may be missing and i'm just not seeing something stupid.

​The admin panel:

 

<?php
/*
  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com
  Copyright © 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://64.64.0.104/~bowhunte'); // eg, http://localhost - should not be empty for productive servers
  define('HTTP_CATALOG_SERVER', 'http://64.64.0.104/~bowhunte');
  define('HTTPS_CATALOG_SERVER','https://64.64.0.104/~bowhunte');
  define('ENABLE_SSL_CATALOG', 'false'); // secure webserver for catalog module
  define('DIR_FS_DOCUMENT_ROOT', '/home/bowhunte/public_html/'); // where the pages are located on the server
  define('DIR_WS_ADMIN', '/admin/'); // absolute path required
  define('DIR_FS_ADMIN', '/home/bowhunte/public_html/admin/'); // absolute pate required
  define('DIR_WS_CATALOG', '/'); // absolute path required
  define('DIR_FS_CATALOG', DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG);
//  define('DIR_FS_CATALOG', '/home/bowhunte/public_html/'); // absolute path required
  define('DIR_WS_IMAGES', 'images/');
  define('DIR_WS_HTTPS_CATALOG', '/');
  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', 'REMOVED');
  define('DB_SERVER_PASSWORD', REMOVED');
  define('DB_DATABASE', 'REMOVED');
  define('USE_PCONNECT', 'false'); // use persisstent connections?
  define('STORE_SESSIONS', 'mysql'); // leave empty '' for default handler or set to 'mysql'
?>

 

 

 

 

 

THE MAIN INCLUDE

 

 

<?php
/*
  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com
  Copyright © 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://64.64.0.104/~bowhunte/'); // eg, http://localhost - should not be empty for productive servers
  define('HTTPS_SERVER', 'https://64.64.0.104/~bowhunte/'); // eg, https://localhost - should not be empty for productive servers
  define('ENABLE_SSL', false); // secure webserver for checkout procedure?
  define('HTTP_COOKIE_DOMAIN', '64.64.0.104');
  define('HTTPS_COOKIE_DOMAIN', '64.64.0.104');
  define('HTTP_COOKIE_PATH', '/');
  define('HTTPS_COOKIE_PATH', '/');
  define('DIR_WS_HTTP_CATALOG', '/');
  define('DIR_WS_HTTPS_CATALOG', '/');
  define('DIR_WS_IMAGES', 'images/');
  define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
  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_DOWNLOAD_PUBLIC', 'pub/');
  define('DIR_FS_CATALOG', '/home/bowhunte/public_html/');
  define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
  define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');
// define our database connection
  define('DB_SERVER', 'localhost'); // eg, localhost - should not be empty for productive servers
  define('DB_SERVER_USERNAME', REMOVED');
  define('DB_SERVER_PASSWORD', 'REMOVED');
  define('DB_DATABASE', REMOVED');
  define('USE_PCONNECT', 'false'); // use persistent connections?
  define('STORE_SESSIONS', 'mysql'); // leave empty '' for default handler or set to 'mysql'
  // CLR 020605 defines needed for Product Option Type feature
define('PRODUCTS_OPTIONS_TYPE_SELECT', 0);
define('PRODUCTS_OPTIONS_TYPE_TEXT', 1);
define('PRODUCTS_OPTIONS_TYPE_RADIO', 2);
define('PRODUCTS_OPTIONS_TYPE_CHECKBOX', 3);
define('PRODUCTS_OPTIONS_TYPE_TEXTAREA', 4); // DDB - 041107 - add textarea field
define('TEXT_PREFIX', 'txt_');
define('PRODUCTS_OPTIONS_VALUE_TEXT_ID', 0); //Must match id for user defined "TEXT" value in db table TABLE_PRODUCTS_OPTIONS_VALUES
?>
Link to comment
Share on other sites

Some people turn error reporting off. Maybe the previous webmaster turned it off. Make sure it's turned on. Here's how you can do it site wide or per file.

 

Put  this just above the message stack if it's not there. if it is set it to 1.

 

ini_set('display_errors',1);
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);

If its only the one page you want to find errors in add this to the top of the file you are working on.

ini_set('display_errors',1);
error_reporting(E_ALL);

You can look in the file error.log as well for errors that have been logged.

You can also look in cPanel (if you have that) and see any errors there as well.

Link to comment
Share on other sites

I ran the error log.. the one in bold is the one that worries me the most.  I tried to roll back to PHP 5.3 and had the same errors so I am certain it is not the PHP versioning causing the problems.

 

Sun Oct 02 00:52:14.834831 2016] [:error] [pid 3153] [client 108.36.72.50:50688] PHP Deprecated:  Function ereg() is deprecated in /home/bowhunte/public_html/admin/configuration.php on line 80, referer: http://64.64.0.104/~bowhunte/admin/
[sun Oct 02 00:52:14.834663 2016] [:error] [pid 3153] [client 108.36.72.50:50688] PHP Deprecated:  Function ereg() is deprecated in /home/bowhunte/public_html/admin/configuration.php on line 80, referer: http://64.64.0.104/~bowhunte/admin/
[sun Oct 02 00:52:14.829777 2016] [:error] [pid 3153] [client 108.36.72.50:50688] PHP Warning:  include(): Failed opening 'includes/languages/english/' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bowhunte/public_html/admin/includes/application_top.php on line 135, referer: http://64.64.0.104/~bowhunte/admin/
[sun Oct 02 00:52:14.829761 2016] [:error] [pid 3153] [client 108.36.72.50:50688] PHP Warning:  include(/home/bowhunte/public_html/admin/includes/languages/english): failed to open stream: Permission denied in /home/bowhunte/public_html/admin/includes/application_top.php on line 135, referer: http://64.64.0.104/~bowhunte/admin/

[sun Oct 02 00:52:14.828856 2016] [:error] [pid 3153] [client 108.36.72.50:50688] PHP Deprecated:  Function eregi() is deprecated in /home/bowhunte/public_html/admin/includes/classes/language.php on line 87, referer: http://64.64.0.104/~bowhunte/admin/
[sun Oct 02 00:52:14.828847 2016] [:error] [pid 3153] [client 108.36.72.50:50688] PHP Deprecated:  Function eregi() is deprecated in /home/bowhunte/public_html/admin/includes/classes/language.php on line 87, referer: http://64.64.0.104/~bowhunte/admin/
[sun Oct 02 00:52:14.828838 2016] [:error] [pid 3153] [client 108.36.72.50:50688] PHP Deprecated:  Function eregi() is deprecated in /home/bowhunte/public_html/admin/includes/classes/language.php on line 87, referer: http://64.64.0.104/~bowhunte/admin/
[sun Oct 02 00:52:14.828828 2016] [:error] [pid 3153] [client 108.36.72.50:50688] PHP Deprecated:  Function eregi() is deprecated in /home/bowhunte/public_html/admin/includes/classes/language.php on line 87, referer: http://64.64.0.104/~bowhunte/admin/
[sun Oct 02 00:52:14.828812 2016] [:error] [pid 3153] [client 108.36.72.50:50688] PHP Deprecated:  Function eregi() is deprecated in /home/bowhunte/public_html/admin/includes/classes/language.php on line 87, referer: http://64.64.0.104/~bowhunte/admin/
[sun Oct 02 00:52:14.828802 2016] [:error] [pid 3153] [client 108.36.72.50:50688] PHP Deprecated:  Function eregi() is deprecated in /home/bowhunte/public_html/admin/includes/classes/language.php on line 87, referer: http://64.64.0.104/~bowhunte/admin/
[sun Oct 02 00:52:14.828791 2016] [:error] [pid 3153] [client 108.36.72.50:50688] PHP Deprecated:  Function eregi() is deprecated in /home/bowhunte/public_html/admin/includes/classes/language.php on line 87, referer: http://64.64.0.104/~bowhunte/admin/
[sun Oct 02 00:52:14.828779 2016] [:error] [pid 3153] [client 108.36.72.50:50688] PHP Deprecated:  Function eregi() is deprecated in /home/bowhunte/public_html/admin/includes/classes/language.php on line 87, referer: http://64.64.0.104/~bowhunte/admin/
[sun Oct 02 00:52:14.828755 2016] [:error] [pid 3153] [client 108.36.72.50:50688] PHP Deprecated:  Function eregi() is deprecated in /home/bowhunte/public_html/admin/includes/classes/language.php on line 87, referer: http://64.64.0.104/~bowhunte/admin/
[sun Oct 02 00:52:14.822872 2016] [:error] [pid 3153] [client 108.36.72.50:50688] PHP Deprecated:  mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/bowhunte/public_html/admin/includes/functions/database.php on line 19, referer: http://64.64.0.104/~bowhunte/admin/
 

Link to comment
Share on other sites

You just gave all of the hackers the location of your Admin, and the fact that you are running an ancient version of osC that has known security vulnerabilities. I hope that you have that Admin locked down with .htaccess/.htpasswd security or your server is toast.

 

The error message that has you concerned is caused by another old bug in osCommerce. I don't remember the exact fix, but you can search the forum for "language bug" and find some solutions.

 

PHP 5.3 has known security vulnerabilities as well, so staying on that version is particularly dangerous. Actually any version older than 5.6 is unsupported and can be assumed to be unsafe to use.

 

You have a lot of work ahead of you to make that old software usable and safe. It would certainly take a lot less work to upgrade to a modern version. There is also much better support for the modern versions of osC, since there are very few of us left who remember the 2.2 series.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

A 404 error is usually a "page not found" error. Are you sure your URL is corret? An incorrect written URL can cause the link to be broken. On the shop side your Categories URL's apper to be working.

You can clear the cache through the browser. For Mozilla go to Options - Privacy - You may also want to clear all current history. Click the "clear all current history" and procced. Once the pop up appears, set it per your need and then click the Clear Now button.
On Mac this is the shortcut on your keyboard: Shift+Command+Delete.
On Windows, this is the shortcut on your keyboard: Ctrl+Shift+Delete.

Most or these are deprecated errors. Change eregi() to preg_match() and change mysql_connect() to mysqli_connect()

Both of the below are includes/ issues To do with the language files. Make sure the permissions are correct for that folder and the files.

For this error Warning:  include(): Failed opening 'includes/languages/english/' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bowhunte/public_html/admin/includes/application_top.php on line 135, referer: http://64.64.0.104/~bowhunte/admin/
You can try include_once(). Notice the "For this error /languages/english/" You have to make sure the file your looking for is there. Also make sure it has the permissions set correctly.

For this error Warning:  include(/home/bowhunte/public_html/admin/includes/languages/english): failed to open stream: Permission denied in /home/bowhunte/public_html/admin/includes/application_top.php on line 135, referer: http://64.64.0.104/~bowhunte/admin/
Set your permissions correctly.

 

Make sure you have the correct PHP version set in you cPanel or the like.

 

You really should update your files and PHP version.

 

Bill

Link to comment
Share on other sites

I forgot to mention that I may know who your supplier is. Or at least one of them. Your products look similar to what I've seen and so does your site. If I'm correct about your supplier, Dave is the webmaster there. He can help you with an update. Not sure if there would be a fee or not.

 

Bill

Link to comment
Share on other sites

All those ereg* errors will need to be cleaned up, along with whatever errors pop up next. You also will soon need to upgrade to the MySQLi interface. I agree with Jim that you are absolutely wasting your time trying to bring such an old (2.2) version up  to snuff, and should be starting over with the latest (2.3.4 BS Edge). Note that all your data can be brought over (the database schema will need to be updated, either manually or via some add-ons). If you have "too many customizations", regard it as a hard-learned lesson about writing down what changes you make (including add-ons installed) and why you made those changes. Eventually, you'll have to upgrade to a new osC base again, and having a complete record of what (and why) you changed will make the process go smoothly. That's just the nature of software.

Link to comment
Share on other sites

So I don't disagree with any of that. If this were my site or my employer I agree. I'm only doing this as I'm helping a friend get the site working with the newest php and PayPal requirements as per his employer but they don't want to spend money to do it right. My initial reaction was to go to 2.4.4 with php 5.6 but there is no upgrade path from 2.2 -> 2.3 and since this is a favor and not a paid gig I'm not spending a hundred hours on it for a company that frankly could afford to do it right.

 

That said thanks for the help Ecom as that did fix the admin side and I have already cleaned the mysqli and Geri lines since I know how to fix them. My issues were the errors. I now have to focus on front end where the catalog links try to open real HTML pages versus dynamic pages. I'm guessing this is again some stupid permissions or include that the real server guys setup wrong and it's now on me to find.

Link to comment
Share on other sites

My advice is to walk away. You are going to spend a hundred (or more) hours fixing this old code, at least if you do it properly. By properly I mean a fully working, secure site. If you're not willing to donate all of that work, and you friend is not able to do it, his employer needs to hire somebody who can. It's that simple.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

@@duckydan

If you have anymore issues that you feel you need help with I can try to assist you. If you think you've can handle it on your own that's great. If you consider the issues you've mentioned to be solved, then please mark this thread as solved.

 

Bill

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...