Search code examples
phpmysqlcakephppdocake-console

Cake Console won't work on Mac OS X Lion


I just downloaded CakePHP 2.1 and did all the setup for the database and all the rest, but I'm unable to use the cake console, I get the following error:

Error: Database connection "Mysql" is missing, or could not be created.

If I open the site on my browser I see this:

enter image description here

This is my database.php:

public $default = array(                                                                                                                                              
  'datasource' => 'Database/Mysql',                                                                                                                                   
  'persistent' => false,                                                                                                                                              
  'host' => '127.0.0.1',                                                                                                                                              
  'login' => 'user',                                                                                                                                                  
  'password' => 'password',                                                                                                                                        
  'database' => 'database_schema',                                                                                                                                    
  'prefix' => '',                                                                                                                                                     
  'encoding' => 'utf8',                                                                                                                                               
  'port' => ' /Applications/xampp/xamppfiles/var/mysql/mysql.sock',                                                                                                   
);

I'm using XAMPP 1.7.3, I read that the issue might be related to PDO, but I have no idea how to set it up properly, any suggestions?


Solution

  • You should enable the php_pdo_extension in php.ini. The file is located at /Applications/XAMPP/etc/php.ini by default.