CakePHP 'Cake is NOT able to connect to the database'
Posted
by
kand
on Stack Overflow
See other posts from Stack Overflow
or by kand
Published on 2011-07-31T17:10:34Z
Indexed on
2012/09/22
15:37 UTC
Read the original article
Hit count: 281
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:
- Changing my database.php so that the 'port' attribute for both $default and $test are the location of my mysqld.sock file
- Changing the 'port' attribute to the actual integer that represents the port in my my.cnf mysql config
- 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 match 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.
© Stack Overflow or respective owner