PDA

View Full Version : PHP Site - Setting up DB with XAMPP/DW CS4



Kirk_Bishopp
06 Jul 2012, 01:44 PM
Hello,

I've setup a local copy of a php site in DW cs4. I have XAMPP installed and working (used a small test site to verify everything is working). I downloaded a copy of the site's DB and imported it into XAMPP and it seems to work... I took some SQL queries from the code of the site and ran them directly from phpMyAdmin and got results from them. I went into DW and set up a DB connection and when I test the connection (test button) it says the connection was made successfully. When I try to 'live view' the local copy of index.php I get a blank page with a message: "Could not connect to mysql. Please check your database settings." I also found where this message is originating from in config.php... there is an if statement that tests the connection:

if (!$conn->Connect($DBHOST, $DBUSER, $DBPASSWORD, $DBNAME) ) {
echo 'error here';
die();

I know the DB name is the same, I made sure to import it using the exact same name. When I set up the db connection in DW I used the user root and the pw that goes with that, but the site doesn't contain that info.

Where would I find out where the site specifies user and pw for the DB?

What is the DBHOST?


Thanks for any help you can provide.

Kirk

Kirk_Bishopp
06 Jul 2012, 05:47 PM
DBHOST was localhost
user and pw specified in config.local.php

Got all that straightened out, but now more issues. When I try to view index.php in a browser, I get a blank page (in FF and Chrome - in IE I'm getting a HTTP 500 error. I have read that there are some logs in XAMPP that should detail what happened to cause the error... anyone know where this error log would be?