bramleydesign Posted September 1, 2010 Share Posted September 1, 2010 This comes up when trying to access my admin page: Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/fhlinux199/b/bramleydesign.co.uk/user/htdocs/catalog/admin/includes/functions/database.php on line 19 Unable to connect to database server! And heres my admin/includes/configure.php, does anyone know whats wrong with it? ive found some similar threads on this forum and ive changed a few things but i still get that message coming up. define('HTTP_SERVER', 'http://bramleydesign.co.uk'); // eg, http://localhost or - https://localhost should not be NULL for productive servers define('HTTP_CATALOG_SERVER', 'http://bramleydesign.co.uk'); define('HTTPS_CATALOG_SERVER', 'http://bramleydesign.co.uk/catalog'); define('ENABLE_SSL_CATALOG', 'false'); // secure webserver for catalog module define('DIR_FS_DOCUMENT_ROOT', $DOCUMENT_ROOT); // where your pages are located on the server. if $DOCUMENT_ROOT doesnt suit you, replace with your local path. (eg, /usr/local/apache/htdocs) define('DIR_WS_ADMIN', '/admin/'); define('DIR_FS_ADMIN', DIR_FS_DOCUMENT_ROOT . DIR_WS_ADMIN); define('DIR_WS_CATALOG', '/catalog/'); define('DIR_FS_CATALOG', DIR_FS_DOCUMENT_ROOT . DIR_WS_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 our database connection define('DB_SERVER', 'xxx.xxx.xxx.xxx'); define('DB_SERVER_USERNAME', 'xxxxx'); define('DB_SERVER_PASSWORD', 'xxxxx'); define('DB_DATABASE', 'xxxxxxxx'); define('USE_PCONNECT', 'false'); define('STORE_SESSIONS', 'mysql'); Link to comment Share on other sites More sharing options...
♥mdtaylorlrim Posted September 1, 2010 Share Posted September 1, 2010 Unless you are trying to use different user credentials for database access for web users and store administrators (like I am) then this: // define our database connection define('DB_SERVER', 'xxx.xxx.xxx.xxx'); define('DB_SERVER_USERNAME', 'xxxxx'); define('DB_SERVER_PASSWORD', 'xxxxx'); define('DB_DATABASE', 'xxxxxxxx'); define('USE_PCONNECT', 'false'); define('STORE_SESSIONS', 'mysql'); Should be the same as in your /catalog/includes/configure.php file, IIRC. Community Bootstrap Edition, Edge Avoid the most asked question. See How to Secure My Site and How do I...? Link to comment Share on other sites More sharing options...
bramleydesign Posted September 1, 2010 Author Share Posted September 1, 2010 Iam very new to php so finding it all very confusing, I already had the database info up but thanks anyway . ill put both the admin/includes/configure.php and includes/configure.php up because ive done something else to it now and its saying : The requested URL /admin/login.php was not found on this server. Can anyone help and tell me whats wrong with both of these?thanks heres my admin/includes/configure.php : // define our webserver variables // DIR_FS = Filesystem (physical) // DIR_WS = Webserver (virtual) define('HTTP_SERVER', 'http://bramleydesign.co.uk'); // eg, http://localhost or - https://localhost should not be NULL for productive servers define('HTTP_CATALOG_SERVER', 'http://bramleydesign.co.uk'); define('HTTPS_CATALOG_SERVER', 'https://bramleydesign.co.uk/catalog'); define('ENABLE_SSL_CATALOG', 'false'); // secure webserver for catalog module define('DIR_FS_DOCUMENT_ROOT', $DOCUMENT_ROOT); // where your pages are located on the server. if $DOCUMENT_ROOT doesnt suit you, replace with your local path. (eg, /usr/local/apache/htdocs) define('DIR_WS_ADMIN', '/admin/'); define('DIR_FS_ADMIN', DIR_FS_DOCUMENT_ROOT . DIR_WS_ADMIN); define('DIR_WS_CATALOG', '/catalog/'); define('DIR_FS_CATALOG', DIR_FS_DOCUMENT_ROOT . DIR_WS_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 our database connection define('DB_SERVER', '***.171.***.243'); define('DB_SERVER_USERNAME', '******'); define('DB_SERVER_PASSWORD', '******'); define('DB_DATABASE', 'bramleyonline'); define('USE_PCONNECT', 'false'); define('STORE_SESSIONS', 'mysql'); ?> And here is my includes/configure.php // Define the webserver and path parameters // * DIR_FS_* = Filesystem directories (local/physical) // * DIR_WS_* = Webserver directories (virtual/URL) define('HTTP_SERVER', 'http://bramleydesign.co.uk'); // eg, http://localhost - should not be empty for productive servers define('HTTPS_SERVER', 'http://bramleydesign.co.uk'); // eg, https://localhost - should not be empty for productive servers define('ENABLE_SSL', false); // secure webserver for checkout procedure? define('HTTP_COOKIE_DOMAIN', 'http://bramleydesign.co.uk'); define('HTTPS_COOKIE_DOMAIN', 'http://bramleydesign.co.uk'); define('HTTP_COOKIE_PATH', 'http://bramleydesign.co.uk'); define('HTTPS_COOKIE_PATH', 'http://bramleydesign.co.uk'); define('DIR_WS_HTTP_CATALOG', 'http://bramleydesign.co.uk/catalog'); define('DIR_WS_HTTPS_CATALOG', 'http://bramleydesign.co.uk/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_DOWNLOAD', DIR_FS_CATALOG . 'download/'); define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/'); // define our database connection define('DB_SERVER', '***.171.***.243'); // eg, localhost - should not be empty for productive servers define('DB_SERVER_USERNAME', '******'); define('DB_SERVER_PASSWORD', '******'); define('DB_DATABASE', 'bramleyonline'); define('USE_PCONNECT', 'false'); // use persistent connections? define('STORE_SESSIONS', 'mysql'); // leave empty '' for default handler or set to 'mysql' Link to comment Share on other sites More sharing options...
♥mdtaylorlrim Posted September 1, 2010 Share Posted September 1, 2010 When I see configure file that have as many inconsistencies as does yours I am afraid to touch it, lest I make it worse. Just because some template might actually need screwy settings... But this just does not seem right to me... define('HTTP_CATALOG_SERVER', 'http://bramleydesign.co.uk'); define('HTTPS_CATALOG_SERVER', 'https://bramleydesign.co.uk/catalog'); define('ENABLE_SSL_CATALOG', 'false'); // secure webserver for catalog module define('DIR_FS_DOCUMENT_ROOT', $DOCUMENT_ROOT); // where your pages are located on the server. if $DOCUMENT_ROOT doesnt suit you, replace with your local path. (eg, /usr/local/apache/htdocs) define('DIR_WS_ADMIN', '/admin/'); define('DIR_FS_ADMIN', DIR_FS_DOCUMENT_ROOT . DIR_WS_ADMIN); define('DIR_WS_CATALOG', '/catalog/'); You are defining your document root based on server environment settings, then define the admin directory, and FINALLY you define the catalog, therefore, your admin directory is missing the requisite /catalog/ in the url. Community Bootstrap Edition, Edge Avoid the most asked question. See How to Secure My Site and How do I...? Link to comment Share on other sites More sharing options...
bramleydesign Posted September 1, 2010 Author Share Posted September 1, 2010 The site was working earlier, but i played around with both these configure.php, Dont ask why. And so i went back to the very original files i had downloaded off oscommerce and tried to fill in the gaps. is there not a structured way these configure.php files are put together? Link to comment Share on other sites More sharing options...
♥mdtaylorlrim Posted September 2, 2010 Share Posted September 2, 2010 The site was working earlier, but i played around with both these configure.php, Dont ask why. And so i went back to the very original files i had downloaded off oscommerce and tried to fill in the gaps. is there not a structured way these configure.php files are put together? Yes, sort of. But you have to be able to do some critical thinking. This starts it... define('DIR_FS_DOCUMENT_ROOT', $DOCUMENT_ROOT); Then this part adds your directory that your store is actually in. define('DIR_WS_CATALOG', '/catalog/'); Then, the following line describes where to find your admin directory... define('DIR_FS_ADMIN', DIR_FS_DOCUMENT_ROOT . DIR_WS_ADMIN); So, you define you admin as being at DIR_FS_DOCUMENT_ROOT together with DIR_WS_ADMIN, BUT it does not include the DIR_WS_CATALOG. So, if DIR_FS_DOCUMENT_ROOT is at /home/yourname/public_html and DIR_WS_ADMIN is /admin then DIR_FS_ADMIN will end up at /home/yourname/public_html/admin Except that your DIR_WS_CATALOG is at /catalog/ so your admin should really be at /home/yourname/public_html/catalog/admin but that is not the result of your code... Besides, it is not really good coding techniques to mix the WS defines with the FS defines... one denotes webspace paths to be included in URLs and the other is filespace paths to be used in php coding to file paths. I'd suggest going back to the original configure.php files in your install media, or backups. You do have backups, right? I don't know...maybe someone else would be willing to sort it all out for you.. Community Bootstrap Edition, Edge Avoid the most asked question. See How to Secure My Site and How do I...? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.