DON’T READ THIS! READ THIS.

Or How to setup a MAMP Stack on… Mac OS X: a proper write up.

Please disregard the gubbins on this post…

[OK – this was going to be a simple step-by-step account of how to install a particular project management system on a Mac OS X box. That particular project stalled but I learnt a few things about how to get a [M]AMP stack setup to the point a which I can continue… ]

Need a project management package. So far requirements and research lead to Open Goo.

  • Download package from OpenGoo.
  • Create a MySQL database for it.
      • [unstuff it and put the folder into ~/Sites/ , for example]
      • virtualhost it
    • fix socket error (?)
      • http://dev.mysql.com/doc/refman/5.0/en/mac-os-x-installation.html: edit (with TextWrangler of course) /etc/php.ini so that  “mysql.default_socket = /tmp/mysql.sock”
    • Fix mcrypt error: “Cannot load mcrypt extension. Please check your PHP configuration”
    • Ditch the default OS X PHP install in favour of Marc Liyanage’s packaged instal of PHP for Mac OS X
      • If already set up the Apple version of PHP – make sure it’s disabled:  “LoadModule php5_module”  in /private/etc/apache2/httpd.conf shoul commented out
      • Download and run Marc’s installer from the link above. RTFM mind – but it’s a cinch. The new PHP files will now be in /usr/local/php5.
      • Also ditch any previously installed MySQL
        • sudo rm /usr/local/mysql
        • sudo rm -rf /usr/local/mysql*
        • sudo rm -rf /Library/StartupItems/MySQLCOM
        • sudo rm -rf /Library/PreferencePanes/My*
        • edit /etc/hostconfig and remove the line MYSQLCOM=-YES-
        • sudo rm -rf /Library/Receipts/mysql*
        • sudo rm -rf /Library/Receipts/MySQL*
    • install to match the PHP  package to MySQL 5.0.77
  • Create a privileged MySQL user. (Any user may log in without  a password to get an anonymous session: “No Privileges”. Mac OS X user account – or _mysql. At this stage  log in without a password.)
  • Ye-har! Who’d of guessed… Apple’s MySQL documentation was where to find simple instructions for how to give the MySQL root user a password – and hence succeed to log inwith privileges. Terminal command: /usr/local/mysql/bin/mysqladmin -u root password sniggle. Where sniggle is your choice for a secure password.
  • For each DB user you should add that user with an MySQL query:
    CREATE USER 'user1'@'localhost' IDENTIFIED BY'pass1';