Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Never edit your web URL again! (configure.php)


cavern

Recommended Posts

Posted

I've always wondered why osCommerce doesn't have a more dynamic configure.php page for how robust it actually is.

 

Like others, I tend to test the cart in house before uploading it to wherever I need to run the store. Sure going in to change the config.php file isn't that hard, but what if your dedicated box (or shared) has the exact same setup, minus the URL changes? Its rather annoying to go and change URLs, paths, etc each time you move or upload the files.

 

I came up with this, and it works perfectly for me, sub domains, folders past root, doesnt matter.

 

Current osCommerce Code:

 

define('HTTP_SERVER', 'http://yoururlhere');
define('HTTPS_SERVER', 'http://yoururlhere');

define('HTTP_COOKIE_DOMAIN', 'domainname');
define('HTTPS_COOKIE_DOMAIN', 'domainname');

define('DIR_FS_CATALOG', '/var/www/html/catalog/');

My new code:

 

$domainurl = "http://" . $_SERVER['SERVER_NAME'];
$domainname = $_SERVER['SERVER_NAME'];

define('HTTP_SERVER', $domainurl);
define('HTTPS_SERVER', $domainurl);

define('HTTP_COOKIE_DOMAIN', $domainname);
define('HTTPS_COOKIE_DOMAIN', $domainname);

define('DIR_FS_CATALOG', $_SERVER['DOCUMENT_ROOT'] . '/catalog/');

 

This allows me to upload directly to my dedicated box, and I never have to touch the configure.php. Granted some people need to change their SQL information, but I have it include a file thats NOT in the public web section with all the proper information, then use variables to feed it.

 

Just my .2 cents, enjoy!

  • 3 months later...
Posted

I can get this to work ok on catalogue/includes/configure.php. But cannot figure out what catalogue/admin/includes/configure.php. should be Can anyone help with configure file for admin in rc1, showing what needs to be altered.

 

Is there any drawback to using this?

Posted
but I have it include a file thats NOT in the public web section with all the proper information

 

Is there a private oscommerce forum/section?

Posted

I personally rather use my own configure.php next to the one of the production store in 'catalog/includes/local'. In the oscommerce-download is a readme there that states

 

This directory contains local configuration information.

 

It also must contain a file named configure.php that can be used to override

the defaults set in application_top.php

 

Remember to execute PHP commands the file needs to start with <?php and end with ?>

 

Before you upload to the site, simply remove your catalog/includes/local/configure.php and you're done.

 

Just my 2 cts

Posted

I've always wondered why osCommerce doesn't have a more dynamic configure.php page for how robust it actually is.

 

It is robust .. it works .. yours doesn't.

Archived

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

×
×
  • Create New...