1

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

3 Answers 3

4

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]

Sign up to request clarification or add additional context in comments.

Comments

2

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

3 Comments

@Tiz did you check permissions for this file?
It needs to be in one of the include paths (/var/www/projects/lib:.:/usr/share/php:/usr/share/pear) or the working directory of the script including it.
even if I try to put it in these path, it still tells me that I have no database.php file.
0

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.

1 Comment

unluckly no, cakephp still telling me that database.php isn't there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.