开发者

CakePHP 'Cake is NOT able to connect to the database'

I've looked at this post about a similar issue:

CakePHP: Can't access MySQL database

and I've tried everything they mentioned in there including:

  1. Changing my database.php so that the 'port' attribute for both $default and $test are the location of my mysqld.sock file
  2. Changing the 'port' attribute to the actual integer that represents the port in my my.cnf mysql config
  3. Changing the mysql socket locations in php.ini to the location of my mysqld.sock file

I'm using ubuntu 11.04, apache 2.2.17, mysql 5.1.54, and CakePHP 1.3.10. My install of mysql and apache don't seem to ma开发者_开发百科tch any conventions, as in, all the config files are there, they are all just in really weird places--I'm not sure why that is, but I've tried reinstalling both programs multiple times with the same results...

At any rate, I can log into mysql from the terminal and use it normally, and apache is working because I can see the CakePHP default homepage. I just can't get it to change the message 'Cake is NOT able to connect to the database'.

SOLVED: Figured it out, had to change php.ini so that extension_dir pointed to the correct directory and had to add a line extension=mysql.so.


I just got my cake php to work. OMG it sucked. I'm going to make a video tutorial on my blog when I get a chance to make it easy to install and show all the errors and how to fix them.

go into apache and turn this on in the apache modules: rewrite_module. For me in wamp, I just go to apache -> apache modules -> rewrite_module.

Then restart. I had to do this 3 times before it worked.

Then go into the php.ini and turn this on: extension=php_pdo_mysql.dll, by getting rid of the semicolon in the front of it. Then restart again.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜