Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Unable to connect to database server


Guest

Recommended Posts

I have run the install on an EV-1 server. The server is a windows 2003 standard edition server. The install runs to completion with no errors. When it gets to the end of the install and gives me the option of going to the administration or catalog pages I click on the ?Administration? button and I get a page that says ?Unable to connect to database server!? and the catalog button gives me a ?page not found? error. I have remote desktop access to this machine so I can see the database through the MySQL admin utility and the newly created database is there complete with all the new tables. I have been through this several times and have deleted the database and then rerun the install to make sure it is creating the database and it is. It is creating the database with the username and password I provided.

 

So the question is why isn?t it connecting to the database? And why isn?t the ?catalog? link taking me to the new osCommerce splash page.

Link to comment
Share on other sites

OK I got the config files down and I?m looking at them (this is the admin config file). The problem is that I?m not sure what I?m looking at. In the upper section ?define webserver variables? A lot of this appears to be undefined that is if I am understanding what I?m looking at. I am only just beginning to learn PHP and in fact this osCommerce project is part of that.

 

(this is not the whole file, just the parts dealing with catalog and admin)

 

define('HTTP_SERVER', '');

define('HTTP_CATALOG_SERVER', '');

define('HTTPS_CATALOG_SERVER', '');

define('ENABLE_SSL_CATALOG', 'false');

define('DIR_FS_DOCUMENT_ROOT', $DOCUMENT_ROOT);

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);

 

This is the lower section that defines the DB connection and again this section appears to be entirely undefined or defined with default values and completely oblivious to the values I entered during setup.

 

define('DB_SERVER', '');

define('DB_SERVER_USERNAME', 'mysql');

define('DB_SERVER_PASSWORD', '');

define('DB_DATABASE', 'osCommerce');

define('USE_PCONNECT', 'false');

define('STORE_SESSIONS', '');

 

I?m afraid my PHP skills have not progressed to the point that I can see how this is being used.

Link to comment
Share on other sites

You need to define some things like:

 

define('DB_SERVER', 'localhost');   
define('DB_SERVER_USERNAME', 'mysql'); // Is mysql your database login name?
define('DB_SERVER_PASSWORD', '<enter your database password here>');
define('DB_DATABASE', 'osCommerce'); // Is osCommerce your database name?
define('USE_PCONNECT', 'false'); // OK
define('STORE_SESSIONS', ''); // OK if you want sessions stored in files

 

ed

Link to comment
Share on other sites

OK well I?m afraid this is just the tip of the iceberg. This is just the first file I?ve looked at. Why didn?t this get defined during setup and why did setup run with no errors. Given the reams of files in osCommerce it could take many months to chase down this kind of stuff. Is there something I?m missing in regards to doing a setup on a windows machine? Is there some kind of checklist somewhere that notes everything that needs to be done and everything that needs to be checked? If such a list exist I don?t think I would have a problem going through and setting the correct values.

 

However the really, really disturbing question is why did setup run with no errors? That one fact makes me very untrusting of the entire osCommerce package. I?m hoping it?s just something I did in my setup approach which was basically unpack the file in the folder on the machine through ?Remote Dasktop? and then use my browser to access http://www.adlinda.com/catalog/ That hits the index.php file and from there it?s just follow the instructions. If there is something else that needs to be done I haven?t found it in the documentation.

Link to comment
Share on other sites

it is not the osCommerce package, it is permission settings on your server not being proper during installation.

and probably a host who doent know how to setup things properly.

Link to comment
Share on other sites

OK that may be. I am always tuning permissions especially on a new setup such as this. That being said, if something tries to execute and runs into a permissions issue it will throw an error, and I may have mentioned, I?m not getting any errors of any sort. As for the host, I have total access to this machine and so I can set it up any way that it needs to be in order for this to work. I have other sites on this machine that run php and use the MySQL DB with no problems and in fact this particular site seems to be having no problems running the php scripts simply because the pages work, they display, they function. In fact the only permissions that lay outside of the windows permissions are the MySQL permissions and those obviously are not the problem because as I?ve said, it creates the database with all of the tables, needless to say, it has the proper permissions else we would have no newly created database. As for the windows permissions, they are pretty basic. If they are not configured to allow scripts and executables the php files won?t run and I would never get the first page to come up much less run to completion with no errors. So if it is a mater of something in particular that needs to be configured on the machine all I need to know is what that something is.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...