1
votes

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

3
Have you configured the error log for cakephp? I would look in there first for clues. - muratgu
I'm not sure how to do this I'm afraid. I found configure.php and cake_log.php, but the documentation doesn't really help much when it comes to altering values. As far as I can see the only docs on the cake website relate to logging for your app, not the core cakephp framework. - wheresrhys

3 Answers

1
votes

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.

1
votes

When using phpmyadmin to add a user for phpcake to connect with I had to set the host to localhost instead of %.

0
votes

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