Thursday, January 19, 2012

Macfusion, MacFUSE and OS X Lion

UPDATE (4 Nov 2013): I found the problem with Mavericks - the latest workaround is here.
UPDATE (29 Oct 2013): I just upgraded to Mavericks, and Macfusion is now broken. I've tried every combination of installations, command-line sshfs programs, etc. that I can find and nothing is working yet.  I'll post again if I figure it out, but for now, I guess I'm stuck with Cyberduck. Macfusion should still work if you're running Lion (and maybe Mountain Lion), though.

And another by-product of the Lion upgrade... and a lesson in hasty installations.

Back in Snow Leopard, I had used Macfusion to mount many of the systems that I have ssh access to as devices on my mac - life is so much handier when you can edit and copy files directly without remembering all the proper terminal stuff. You set up the ssh connection once, and forever after you can access your servers with a pull-down menu in the Finder.

After my fresh installation of Lion (see last post), I decided I still wanted this tool, so I downloaded and installed Macfusion, forgetting that back in the day I had to install MacFUSE first. I went to connect to my favorite server, and, what do you know? I get an error:

Mount process has terminated unexpectedly

It took me a few minutes for the "aha! I forgot to install MacFUSE!" So, in my rushed habit, I downloaded the original MacFUSE installer I had used in Snow Leopard, installed, and in its preference pane...

Macfuse does not appear to be installed

Crap. Maybe I need to restart.

Nope.

Okay, maybe Macfusion messed with something by being installed first... After much googling, I figured out how to remove both MacFUSE and Macfusion via a bunch of sudo rm -rf statements (yikes!), and installed in the proper order.

Still the same error.

Okay, maybe this is a Lion issue. Googling that... and yes, it turns out MacFUSE doesn't like the uber-64-bit-ness of Lion. Someone suggested a patched version of MacFUSE that should work, no guarantees...

And, of course, it doesn't fly on my machine.

NOW what? In the same forum, someone whispered something about a proper solution that was in the works: OSXFUSE. A quick peek at the post date, and, yup, that was six months ago. I wonder if it's farther along now...

Yup. And the installer has a nice backward compatibility mode to MacFUSE - and for OCD freaks like me, it also will do the uninstallation of MacFUSE for you as it installs itself so you don't have to do all the unix deleting.

Kudos to Benjamin Fleischer and Erik Larsson. You know software is great when it fixes your problem so fast you hardly remember using it.

Wednesday, January 18, 2012

Getting PHP to run in OS X Lion

So I upgraded to OS X Lion over the weekend. Because I'm OCD, I burned it to a DVD, and did a fresh install on a hard drive I swapped in from a neighbor's dead laptop. Luckily I have a USB - PATA adapter, and just plugged in my old hard drive to copy my files straight over after the installation (check out thinkgeek.com if this sounds like it might help you; they're really handy. You can also probably find a cheaper one than thinkgeek's on ebay if you want to do the leg work).

Anyway, I had a lame little php website in my sites folder - nothing serious for public consumption, but as I work on lots of computers at once, it's handy to just throw a file into my Sites folder so I can access it on another computer without breaking out a flash drive. With the upgrade to OS X Lion, I went through my System Preferences, and turned on Web Sharing, hoping things would work like they did before. Back in Snow Leopard, I had edited /Library/WebServer/Documents/index.html to redirect to /~home/index.php ("home" is my username - yet another OCD quirk), but when I added this tweak in OS X Lion, I just got the php code itself dumped to the browser.

Obviously, this won't do.

Per much advice on the internets, I tried un-commenting this line in /etc/apache2/httpd.conf:

LoadModule php5_module libexec/apache2/libphp5.so
(Note: you'll need to change permissions of the file in order to do this... if you don't like the hassle of doing this on the command line, TextWrangler streamlines this a bit if you try to edit the file directly).

Still just gettting php code. Again, this won't do.

After much playing around with options, I tried dropping the "index.php" from my redirect in /Library/WebServer/Documents/index.html

... and suddenly we're in business.

I'm still a little vague on why - if I find the time to investigate, I'll update.