Tiz
Tiz

Reputation: 423

database.php not found in cakephp setup

I'm new to cakePHP, and I'm trying to make it works under linux mint.

I'have followed the cakephp website tutorial, but when I get to the database section I get this two warning on my page :

 Warning (2): include_once(/var/www/projects/app/Config/database.php) 
[function.include-once]: failed to open stream: No such file or directory 
[CORE/Cake/Model/ConnectionManager.php, line 67]

Warning (2): include_once() [function.include]: 
Failed opening '/var/www/projects/app/Config/database.php' 
for inclusion 
(include_path='/var/www/projects/lib:.:/usr/share/php:/usr/share/pear') 
[CORE/Cake/Model/ConnectionManager.php, line 67]

And I can't get how to fix them.

But my database.php still is not found when I check /localhost/myProject

Upvotes: 1

Views: 1411

Answers (3)

ikaioi
ikaioi

Reputation: 3484

You are in the wrong folder. Always navigate to your APP dir and call the cake console relativly from there

cd c:\wamp\www\project\app\ and execute the command in this folder

\Console\cake [command]

Upvotes: 4

s4suryapal
s4suryapal

Reputation: 1960

Please check your .htaccess files, It should be like this :

In your projects(root) folder :

<IfModule mod_rewrite.c>
   RewriteEngine on
   RewriteRule ^$ app/webroot/ [L]
   RewriteRule (.*) app/webroot/$1 [L]
</IfModule>

In your projects/app folder :

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule    ^$    app/webroot/    [L]
    RewriteRule    (.*) app/webroot/$1    [L]
</IfModule>

In your projects/app/webroot folder :

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>

Hope, this may help you.

Upvotes: 0

Andrey Korchak
Andrey Korchak

Reputation: 2320

Find the file database.php.default in your directory /var/www/projects/app/Config/ and rename this file to database.php

Upvotes: 2

Related Questions