terminal

Setup complete local web server on OSX 10.6 Snow Leopard

As soon as latest versions of Drupal 6 work supposedly fine with PHP 5.3 I decided to give it a try with OSX 10.6 bundled PHP version. Many would say it misses mcrypt, but I don't need it at the moment. Here are a few tips on how to make web development environment working on Snow Leopard. Actually it's probably complete walk trough for majority of cases.

Download and install official MySQL package: http://dev.mysql.com/downloads/mysql/. Then we need to change MySQL socket location as somehow OSX would use not so standard path. Most probably you'll receive "Can't connect to local MySQL server through socket '/var/mysql/mysql.sock'" error in your PHP applications.

Compile and install lynx browser on OSX 10.6

Looks like after setting up PHP I'm now a compile-my-own adept. Here is my take on lynx web browser.

You may ask why would you need lynx at all? Well. There are many uses: usability and accessibility testing, understanding content layout without CSS tricks, checking SEO points (you see the site about the same as search engine sees it) and much much more. After all it looks so geeky :)

Compile PHP 5.2 on OSX 10.6 (Snow Leopard)

Since OSX 10.6 (Snow Leopard) I've gone supposedly easy way using MAMP as dev server. I never really liked it but now it was insane: turned out MAMP is so hogging the system on OSX 10.6. The only way was to have some native 64-bit server running PHP 5.2.x. I really feel that 64-bit apps are much faster at least at releasing some valuable RAM.

I don't yet like MacPorts, not sure for what reason (yep, I'm picky). So the only way was to compile PHP and libraries by myself. Thanks internets (Drew, Stanley, Stewart and others) for tips! Here is my take:

7 tips to power up MAMP on OSX 10.6 (Snow Leopard)

First off I don't really like to go with extra apps on my Mac. So with Leopard I'd use (mark's) PHP (as 10.5.x didn't have GD support at least) and official MySQL distribution. With Snow Leopard (OS X 10.6) Apple did a great job rolling out quite a nice http server but to the date it's way too advanced for my normal dev life. None of the web apps I do develop with (Druapl, ExpressionEngine, Joomla, WP ... ) are ready for PHP 5.3 yet. So the only choice was downgrade.

I've tried a few ways as MacProts, compiling my own PHP (and libs) but that was not even 90% successful or buggy. So I looked to MAMP again. Here are a few tips to get MAMP running nicely at OS X 10.6 (Snow Leopard):

Delete .svn folders on your Mac

Sometimes you need to get rid of .svn hidden folders on your Mac. In my case it was about resyncing my local working copy with client subversion repository. Everything was broken at both ends.

A couple of terminal commands to get rid of unneeded svn tracks:

cd /some/of/your/folders/
rm -rf `find . -type d -name .svn`

It will delete any .svn folders under your current.

For lazy typists: don't forget that you can drag and drop folder from finder to terminal to populate path.

Configuring terminal to work with MAMP mysql on Leopard

I've decided to try MAMP on new Mac OS X 10.5. Mostly because PHP bundled with Leopard doesn't have GD library (otherwise it has quite cool set of modules). The other reason that is better Marc Liyanage's PHP installer is not yet ready for Leopard.

But after backing up all my MySQL databases (around 200Mb dump) it turned out that you can't acces MAMP's mysql via terminal to restore it (or I was something terribly missing from FAQs).