Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Can't connect to database server


semper-linux

Recommended Posts

Using OSC V2.3.1

 

Hi Forum,

 

I installed and ran OSC on a home network for a few weeks basically to build up the database and get familiar with OSC.

 

I have now uploaded the webshop and database to a service provider as I'm ready to go live.

 

Unfortunately I've hit a problem.

When I type in the web address, ( www.custompc.ch ) I get the following error.................

 

Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /mnt/sites/custompc.ch/web/custompc/public_html/catalog/includes/functions/database.php on line 19

Unable to connect to database server!

 

END OF ERROR MESSAGE ********************

 

Should I be entering new config data somewhere ?

 

Any help greatly appreciated.

 

Many thanks

 

semper-linux

Link to comment
Share on other sites

Hi Forum,

 

I think I see the problem.

 

When the shop was installed locally, the database server name was "localhost" and user was root.

 

Now the db server is called "mysql03" and the user name (and password ?) is/are different.

 

Obviously I need to change this somewhere - how do I do this ?

 

many thanks

 

semper-linux

Link to comment
Share on other sites

John,

 

 

Edit the TWO configure.php files located at:

 

/includes/configure.php

/admin/includes/configure.php

 

 

 

 

Chris

Link to comment
Share on other sites

Hi Chris,

 

Thank you very much - reply is spot on - got access to the site.

 

Now, another little problem rears its head - at the top of the home page, I get the following.............

 

"

Warning: session_save_path() [function.session-save-path]: open_basedir restriction in effect. File(/var/www/custompc/public_html/catalog/includes/work/) is not within the allowed path(s): (/mnt/sites/custompc.ch:/tmp:/usr/local/anti-spam:/usr/local/lib/php) in /mnt/sites/custompc.ch/web/custompc/public_html/catalog/includes/functions/sessions.php on line 169

 

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /mnt/sites/custompc.ch/web/custompc/public_html/catalog/includes/functions/sessions.php:169) in /mnt/sites/custompc.ch/web/custompc/public_html/catalog/includes/functions/sessions.php on line 102

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /mnt/sites/custompc.ch/web/custompc/public_html/catalog/includes/functions/sessions.php:169) in /mnt/sites/custompc.ch/web/custompc/public_html/catalog/includes/functions/sessions.php on line 102

 

 

END OF OUTPUT *****************

 

 

Do you have any ideas on this one ?

 

Many thanks

 

John / semper-linux

Link to comment
Share on other sites

Hi Forum,

 

Is this problem also to do with the configure.php files ?

 

Should the following entries be modified.............

 

define('HTTP_SERVER', 'http://127.0.0.1');

 

and

 

define('STORE_SESSIONS', 'mysql');

 

?

 

semper-linux

Link to comment
Share on other sites

John,

 

 

If your website is running on a live server, then your configure.php files should look SIMILAR to this:

 

define('HTTP_SERVER', 'http://www.yourdomain.com');

define('HTTPS_SERVER', 'https://www.yourdomain.com');

define('ENABLE_SSL', true);

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

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

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/html/');

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', 'databaseun');

define('DB_SERVER_PASSWORD', 'databasepw');

define('DB_DATABASE', 'database');

define('USE_PCONNECT', 'false');

define('STORE_SESSIONS', 'mysql');

 

 

 

Chris

Link to comment
Share on other sites

Hi Chris,

 

Thank you very much for your reply - but I'm still getting the same error.

I'm sure I'm not getting the mods correct.

 

I'm taking the liberty of posting both files for your comment......................

 

1)

catalog/includes/configure.php...................

 

<?php

define('HTTP_SERVER', 'http://www.custompc.ch');

define('HTTPS_SERVER', 'http://www.custompc.ch');

define('ENABLE_SSL', false);

define('HTTP_COOKIE_DOMAIN', 'www.custompc.ch');

define('HTTPS_COOKIE_DOMAIN', 'www.custompc.ch');

define('HTTP_COOKIE_PATH', '/custompc/public_html/catalog/');

define('HTTPS_COOKIE_PATH', '/custompc/public_html/catalog/');

define('DIR_WS_HTTP_CATALOG', '/custompc/public_html/catalog/');

define('DIR_WS_HTTPS_CATALOG', '/custompc/public_html/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', '/custompc/public_html/catalog/');

define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

 

define('DB_SERVER', 'mysql03');

define('DB_SERVER_USERNAME', 'user27579');

define('DB_SERVER_PASSWORD', 'acerrt8712');

define('DB_DATABASE', 'db2757902');

define('USE_PCONNECT', 'false');

define('STORE_SESSIONS', 'mysql');

?>

 

and

2)

catalog/admin/includes/cofigure.php

 

<?php

define('HTTP_SERVER', 'http://www.custompc.ch');

define('HTTP_CATALOG_SERVER', 'http://www.custompc.ch');

define('HTTPS_CATALOG_SERVER', 'http://www.custompc.ch');

define('ENABLE_SSL_CATALOG', 'false');

define('DIR_FS_DOCUMENT_ROOT', '/custompc/public_html/catalog/');

define('DIR_WS_ADMIN', '/custompc/public_html/catalog/admin/');

define('DIR_FS_ADMIN', '/custompc/public_html/catalog/admin/');

define('DIR_WS_CATALOG', '/custompc/public_html/catalog/');

define('DIR_FS_CATALOG', '/custompc/public_html/catalog/');

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('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

 

define('DB_SERVER', 'mysql03');

define('DB_SERVER_USERNAME', 'user27579');

define('DB_SERVER_PASSWORD', 'acerrt8712');

define('DB_DATABASE', 'db2757902');

define('USE_PCONNECT', 'false');

define('STORE_SESSIONS', 'mysql');

?>

 

 

Please excuse me for assuming you have the time to look at this - your help is truly appreciated.

 

A similar error happens when I try to log in to admin ( www.custompc.ch/custompc/public_html/catalog/admin/login.php )

 

Many thanks,

 

John.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...