OSCOMMERCE SUPPORT CALL 702-453-3332

 

Help - Search - Members - Calendar
Full Version: Never edit your web URL again! (configure.php)
osCommerce Community Support Forums > osCommerce Online Merchant v2.x > Tips and Tricks
cavern
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:

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:

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!
Brian-Bear
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?
adam777
QUOTE
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?
Brian-Bear
can you post it up? but delete or xxxx out sensitive information
mloeffen
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

QUOTE
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
FWR Media
CODE
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.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.