Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Oscommerce Not Connecting To Database


rmjoe

Recommended Posts

UR: http://www.scanthefan.com/catalog/index.php

 

after some debugging found that in application_top.php

// make a connection to the database... now

tep_db_connect() or die('Unable to connect to database server!');

 

not progressing beyond it. Even though I can connect to database

using mysqladmin.

 

 

Config file has all the parameters defined. Where is the problem.

Any help is appreciated.

 

 

 

define('HTTP_SERVER', 'http://www.scanthefan.com'); // eg, http://localhost - should not be empty for productive servers

define('HTTPS_SERVER', ''); // eg, https://localhost - should not be empty for productive servers

define('ENABLE_SSL', false); // secure webserver for checkout procedure?

define('HTTP_COOKIE_DOMAIN', 'www.scanthefan.com');

define('HTTPS_COOKIE_DOMAIN', 'www.scanthefan.com');

define('HTTP_COOKIE_PATH', '');

define('HTTPS_COOKIE_PATH', '');

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', dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']));

define('DIR_FS_CATALOG', '/home/content/s/c/a/scanthefan/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', 'mysql103.secureserver.net'); // eg, localhost - should not be empty for productive servers

define('DB_SERVER_USERNAME', '*****');

define('DB_SERVER_PASSWORD', '*****');

define('DB_DATABASE', '******');

define('USE_PCONNECT', 'true'); // use persistent connections?

define('STORE_SESSIONS', ''); // leave empty '' for default handler or set to 'mysql'

Link to comment
Share on other sites

First off you should not post your database info

 

second if you are on a shared server you should change the following

 

define('USE_PCONNECT', 'true'); // use persistent connections?

define('STORE_SESSIONS', ''); // leave empty '' for default handler or set to 'mysql'

 

to

 

define('USE_PCONNECT', 'false'); // use persistent connections?

define('STORE_SESSIONS', 'mysql'); // leave empty '' for default handler or set to 'mysql'

 

When I went to your link all I got was a page cannot be found not a database error.

 

If you getting a cannot connect to database error then you have one or more of a few problems.

 

1 incorrect database server info

2. incorrect database name

3. incorrect username

4. incorrcet password

5. You should also make sure that your user is assigned to the database, if it is not then you may get get the same error message. It is a three part process, create dabase, create user, assign user to database

The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

Link to comment
Share on other sites

First off you should not post your database info

 

second if you are on a shared server you should change the following

 

define('USE_PCONNECT', 'true'); // use persistent connections?

define('STORE_SESSIONS', ''); // leave empty '' for default handler or set to 'mysql'

 

to

 

define('USE_PCONNECT', 'false'); // use persistent connections?

define('STORE_SESSIONS', 'mysql'); // leave empty '' for default handler or set to 'mysql'

 

When I went to your link all I got was a page cannot be found not a database error.

 

If you getting a cannot connect to database error then you have one or more of a few problems.

 

1 incorrect database server info

2. incorrect database name

3. incorrect username

4. incorrcet password

5. You should also make sure that your user is assigned to the database, if it is not then you may get get the same error message. It is a three part process, create dabase, create user, assign user to database

 

Thanks for the info. The problem is not that database is erroring out or user does not exists. Problem is nothing happens, no page is displayed when scanthefan.com/catalog url. As part of my debugging, I found that tep_db_connect() or die('Unable to connect to database server!'); in application_top.php is not retruning at all. The way i debugged the problem by putting an echo command afer and before db_connect.

 

A short history : The oscomerce was originally installed on a test server. All the setup was done and changes made. Then tar the files and database. Untared the files and created a database on scanthefan.com (production). Then just made the necessary changes in the config file in catalog and admin directories. But not working. On the test server we used the hosting service provided utility to install the oscommerce, which comes default with hosting service.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...