简体   繁体   English

在cakephp安装程序中找不到database.php

[英]database.php not found in cakephp setup

I'm new to cakePHP, and I'm trying to make it works under linux mint. 我是CakePHP的新手,并且正在尝试使其在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 : 我已经遵循了cakephp网站教程,但是当我进入数据库部分时,在页面上得到了两个警告:

 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 但是当我检查/ localhost / myProject时仍然找不到我的database.php

You are in the wrong folder. 您在错误的文件夹中。 Always navigate to your APP dir and call the cake console relativly from there 始终导航到您的APP目录并从那里相对地调用Cake Console

cd c:\\wamp\\www\\project\\app\\ and execute the command in this folder cd c:\\ wamp \\ www \\ project \\ app \\并在此文件夹中执行命令

\\Console\\cake [command] \\ Console \\ cake [命令]

在目录/ var / www / projects / app / Config /中找到文件database.php.default并将此文件重命名为database.php

Please check your .htaccess files, It should be like this : 请检查您的.htaccess文件,它应该是这样的:

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 : 在您的projects / app / webroot文件夹中:

<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. 希望对您有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 CakePHP:访问database.php值 - CakePHP: Accessing database.php values 单例database.php - Singleton database.php database.php中的环境变量 - Environment variables in database.php CakePHP - cake bake all error(说数据库中缺少 $default。php,但它存在) - CakePHP - cake bake all error (says missing $default in database.php, but it is present) Pagodabox-在/data/vendor/laravel/framework/src/Illuminate/Redis/Database.php:62中找不到类&#39;Predis \\ Client&#39; - Pagodabox - Class 'Predis\Client' not found in /data/vendor/laravel/framework/src/Illuminate/Redis/Database.php:62 在第71行上找不到类“ JFactory” /httpdocs/libraries/joomla/session/storage/database.php - Class 'JFactory' not found /httpdocs/libraries/joomla/session/storage/database.php on line 71 致命错误:在第16行的/home/../../../config/database.php中找不到类“ PDO” - Fatal error: Class 'PDO' not found in /home/../../../config/database.php on line 16 Laravel 更新 database.php 的脚本 - Script to update database.php Laravel Solr(Solarium)与laravel 5在database.php中的连接 - Solr (solarium) connection with laravel 5 in database.php CodeIgniter 和 Parse Server 的 database.php 设置 - database.php settings for CodeIgniter and Parse Server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM