- Enable PHP, install PEAR, update system PATH, and update PHP include_path
Open Terminal and install MDB2:
cd /usr/local sudo pear install MDB2-2.5.0b2 sudo pear install MDB2_Driver_mysql-1.5.0b2
And then…
Install CakePHP DB Migrations
If MDB2 throws a “Native Code: 2002″ error when you “cake migrate” or “cake populate”, PHP is probably looking for mysql.sock in a place it doesn’t exist. Open /etc/php.ini, and locate the following lines (they exist in separate blocks in php.ini, grouped here for brevity):
pdo_mysql.default_socket = /var/mysql/mysql.sock mysql.default_socket = /var/mysql/mysql.sock
Then change the lines to read:
pdo_mysql.default_socket = mysql.default_socket =
By setting an empty default socket, PHP will use the built-in MySOL defaults.
Restart Apache:
sudo /usr/sbin/apachectl restart
↧
CakePHP Migrations on Mac OS X 10.6 Snow Leopard
↧