views:

3608

answers:

4

I've got xampp installed on my laptop runing XP, and it's been running without any problems for ages.

I've just tried installing cakephp, and have altered the database config and enabled mod_rewrite.

But now I get the following on the welcome page:

Your tmp directory is writable.

The FileEngine is being used for caching. To change the config edit APP/config/core.php

Your database configuration file is present.

Cake is NOT able to connect to the database.

I have no idea why it's not connecting to the database. Has anyone else ever come across this problem and have any idea how to resolve it?

*edit Advice on configuring datalogging in cake would be a great help too

+1  A: 

First, edit ~/app/config/core.php and raise debug to 2, this will give you more detailed error reporting.

Second, triple check your ~/app/config/database.php and be 110% sure there is no typo in there. If there is no typo, try connecting with that same data with a non-cake script.

If that fails too, you might want to check Apache and MySQL log files, or even your firewall if you have one.

dr Hannibal Lecter
good tip to try the connection data outside cake. Was a convoluted process, but eventually it got me to the bottom of the problem
wheresrhys
Glad I couly help!
dr Hannibal Lecter
A: 

Have you checked if your database user name and password is correct?

Also ensure that your database does exist.

The following is the default username and password (actually, no password) XAMPP uses:

var $default = array(
 'driver' => 'mysql',
 'persistent' => false,
 'host' => 'localhost',
 'login' => 'root',
 'password' => '',
 'database' => 'db_name',
 'prefix' => '',
);
KahWee Teng
A: 

All you need to do is go to the app/config/database.php. If the file is not there you will definitely find a file by the name of database.php.default. Take a backup of it and rename it to database.php.

Open the file in any text editor. Search for something like this:

var $default = array(
    'driver' => 'mysql',
    'persistent' => false,
    'host' => '',
    'login' => '',
    'password' => '',
    'database' => '',
    'prefix' => '',
);

It'll be at the bottom of the page. Configure the database here and it will start running. Change the 'host','login','password' and 'database'. Then you are done.

Hasan
A: 

I am facing same problem and above things are not working

Sachin Nanaware