Cake无法连接到数据库 [英] Cake is NOT able to connect to the database
问题描述
我使用Wamp服务器,我试图安装CakePHP 2.0.0,但我遇到了麻烦。
I am using Wamp server and I'm trying to install CakePHP 2.0.0 but I'm having trouble with it.
我把CakePHP 2.0.0文件在 wamp
服务器文件夹 www
,然后蛋糕
文件夹。
I put the CakePHP 2.0.0 files in my wamp
server folder "www
" and then "cake
" folder.
当我在浏览器中输入地址 http:// localhost / cake
显示:
When I enter address http://localhost/cake
in my browser then following message is displayed:
CakePHP: the rapid development php framework
Release Notes for CakePHP 2.0.0-dev.
Notice (1024): Please change the value of 'Security.salt' in app/config/core.php to a salt value specific to your application [CORE\Cake\Utility\Debugger.php, line 647]
Notice (1024): Please change the value of 'Security.cipherSeed' in app/config/core.php to a numeric (digits only) seed value specific to your application [CORE\Cake\Utility\Debugger.php, line 651]
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.
Editing this Page
To change the content of this page, create: APP/views/pages/home.ctp.
To change its layout, create: APP/views/layouts/default.ctp.
You can also add some CSS styles for your pages at: APP/webroot/css.
推荐答案
我有同样的问题,研究以确定实际问题。
I had the same problem and it took a lot of researching to determine the actual problem.
新版本的CakePHP使用pdo建立连接,而不是像以前一样建立连接,而不是mysql或mysqli。正在使用Windows环境,只需在php.ini文件中启用以下选项。
The new version of CakePHP uses pdo to establish a connection rather than mysql or mysqli as it did previously. As you are using a Windows environment, just enable the following in php.ini file.
extension = php_pdo_mysql.dll
extension=php_pdo_mysql.dll
与使用根无关,我也发现,当尝试从1.3移动到2.0时真的很烦恼。
NOTHING to do with using root and I also found it an real annoyance when trying to move from 1.3 to 2.0
对于deceze的傲慢回答,我发现没有在CakePHP下载/ install / docs的任何地方提到这个更改。
As for the arrogant answer from deceze, I found NO mention of this change anywhere on the CakePHP download / install / docs.
这篇关于Cake无法连接到数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!