Quantcast
Viewing latest article 4
Browse Latest Browse All 5

CakePHP Migrations on Mac OS X 10.6 Snow Leopard

  1. Enable PHP, install PEAR, update system PATH, and update PHP include_path
  2. 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…

  3. Install CakePHP DB Migrations

  4. 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.

  5. Restart Apache:

    sudo /usr/sbin/apachectl restart
    

Viewing latest article 4
Browse Latest Browse All 5

Trending Articles