Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Creating local version of website


Heatherbell

Recommended Posts

I had created a local version of my OsCommerce Website using XAMPP, and importing my live database.

 

After many hours of struggle, I have a website on localhost, but it won't load any products or categories.

 

I have changed configure.php but it seems that the database is not being accessed.

 

Has anyone else experience in migrating their website this way?

 

I needed a local version to test new features and changes (such as changing php version or adding modules), and would really appreciate a helping hand.

 

Thanks in advance for any responses.

Link to comment
Share on other sites

Thanks for reply.

Yes, I imported the database and the catalog folder from the live site server into XAMPP and changed configure.php. The website is coming up on localhost but no products or categories which makes me think it is not finding the database for some reason - excuse my ignorance here, I really know little about this stuff - might there be something in the database that needs changing or something in XAMPP.

Link to comment
Share on other sites

Hi

On XAMPP here we have a config file that looks like this (catalog side) with the installation in the folder c:/xampp/htdocs/cart 3.

 

Using 127.0.0.1 instead of localhost sometimes helps prevent session loss.

 

It may be that you have an seo urls package installed? Try turning that off or check the .htaccess file for url rewrites?

  define('HTTP_SERVER', 'http://127.0.0.1');
  define('HTTPS_SERVER', 'http://127.0.0.1');
  define('ENABLE_SSL', false);
  define('HTTP_COOKIE_DOMAIN', '');
  define('HTTPS_COOKIE_DOMAIN', '');
  define('HTTP_COOKIE_PATH', '/cart3/');
  define('HTTPS_COOKIE_PATH', '/cart3/');
  define('DIR_WS_HTTP_CATALOG', '/cart3/');
  define('DIR_WS_HTTPS_CATALOG', '/cart3/');
  define('DIR_WS_IMAGES', 'images/');
  define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
  define('DIR_WS_INCLUDES', 'includes/');
  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', 'C:/xampp/htdocs/cart3/');
  define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
  define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

  define('DB_SERVER', 'localhost');
  define('DB_SERVER_USERNAME', 'root');
  define('DB_SERVER_PASSWORD', '');
  define('DB_DATABASE', 'cart3');
  define('USE_PCONNECT', 'false');
  define('STORE_SESSIONS', 'mysql');
  define('CFG_TIME_ZONE', 'Europe/London');
Link to comment
Share on other sites

If it wasn't finding the database, you'd not see any of the website, so its unlikely to be that. As said above, seo rewrites are the usual culprit for this.

 

Look in the apache error log as well, that might give you some pointers.

Link to comment
Share on other sites

Hello,

Thanks to all for advice.

I do have some sort of header tags SEO addon but don't know how to remove it and can't access the admin at all - it gives a Server Error 500 - password problem I think but can't see the problem.

The Apache error.log shows:

[Wed Dec 24 10:44:57.189453 2014] [access_compat:error] [pid 3592:tid 1628] [client ::1:50850] AH01797: client denied by server configuration: C:/xampp/htdocs/catalog/images/index.php, referer: http://localhost');
  define('HTTPS_SERVER', 'http://localhost');
  define('ENABLE_SSL', false);
  define('HTTP_COOKIE_DOMAIN', '');
  define('HTTPS_COOKIE_DOMAIN', '');
  define('HTTP_COOKIE_PATH', '/catalog/');
  define('HTTPS_COOKIE_PATH', '/catalog/');
  define('DIR_WS_HTTP_CATALOG', '/catalog/');
  define('DIR_WS_HTTPS_CATALOG', '/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', 'C:/xampp/htdocs/catalog/');
  define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
  define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');
 
  define('DB_SERVER', 'localhost');
  define('DB_SERVER_USERNAME', 'xxxxxx');
  define('DB_SERVER_PASSWORD', 'xxxxxx');
  define('DB_DATABASE', 'xxxxxx');
  define('USE_PCONNECT', 'false');
  define('STORE_SESSIONS', 'mysql');
?>
 
My live site oscommerce 2.3.2 (working) is hosted with php5.3. The server has advised me to update our site to work with 5.5 which is why I am setting up on a localhost for the first time so I can make all the changes needed for the oscommerce updates to 2.3.4 and php 5.5.
I just copied/pasted everything from the live site.
Many thanks for any help with this.
Link to comment
Share on other sites

Before you spend a lot of time on this (local version of store), let me tell you that it's rarely worth the effort. If you want to do experimentation and development, you're better off just doing it in a test directory on your live server, rather than a local *AMPP installation. First of all, it takes considerable technical skill to manage your own server, something which most people don't have. Second, there will be enough differences between your live server's configuration and your *AMPP (PHP, Apache, MySQL versions) that you will spend lots of time tracking down problems due to the differences, once you move your test site back to the live server.

 

The only time I would contemplate using a local *AMPP server is when you don't have a real live server available, or when you're working with data that's so sensitive that you don't want it on a live server yet (which brings up the point of whether you're going to eventually have that very data on a live server). Don't even think of saving a few dollars a month by hosting your site on your own PC -- hosting is 90% security-related work, and hackers will eat you alive.

Link to comment
Share on other sites

Thank you MrPhil. Hope all had a good Christmas. I have taken your advice and opened another website with our server. Sadly I am having the same problem here http://www.cornishhoney.co.uk/catalog/index.php. The products are not being found and category links are also pointing to the old domain name in spite of me double checking configure.php for correct paths - I am confused. I am also not seeing a session id when I click anything if that helps diagnosis. Search engine URL's set to false (as per one suggestion). Sorry for my lack of knowledge here but several days of googling has got me nowhere - any help please. 

Link to comment
Share on other sites

Search in the database file you restored for the new site and see if the url of your existing web site is in there.

 

If it is it probably needs to be changed to reflect the url of your nes site.

 

HTH

 

G

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

Many thanks Geoffrey. Yes, I did this and found 2 entries in the configure table but the website is still not working correctly. Everything OK when first loading the page (link in previous post) but then categories and products are lost. Any help or suggestions is much appreciated.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...