PECL on OS X Mountain Lion: Quick and dirty

July 29th, 2013 by Sjan Evardsson

Yes, this is pretty simple, but I had to look around for too long to find a solution that didn’t involve homebrew or ports or (even worse) some kind of path manipulation to install PEAR/PECL to MAMP. (No, I do not want to set my bash_profile to use the MAMP PHP over the default. And no, I don’t want to recompile PHP – at least not today and at least not until I want to upgrade the version installed.) I just wanted to install pecl_http to run some tests, and I figured if I didn’t put my notes somewhere I would lose them. So here they are.

Before you begin, you need to have Xcode installed – get it from the app store.

Installing PEAR (which includes PECL) is pretty straight-forward (thanks to Jason McCreary at pureconcepts.net)

Two simple terminal commands, and some configuration:

curl -O http://pear.php.net/go-pear.phar sudo php -d detect_unicode=0 go-pear.phar
sudo php -d detect_unicode=0 go-pear.phar

in the configuration prompt -
Type 1 and then Return
then type:
/usr/local/pear

Type 4 and then return and type
/usr/local/bin

Hit return and you are done (with the first part).

Verify pear with:
pear version

Now, before you run off and type sudo pecl install pecl_http you should know that it will fail, as autoconf is not yet installed. Thankfully, this is quite simple as well, (thanks to This question on serverfault.com)

Download the latest release http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz

Extract the files and do a normal ./configure; make; sudo make install;

Now you can
sudo pecl install pecl_http

Mail.app – Making the switch

February 10th, 2008 by Sjan Evardsson

It has been 10 days now that I have been using Mail.app rather than Thunderbird and I am ready to uninstall Thunderbird entirely. While I am still waiting for GPGMail for 10.5 to advance beyond the beta stage I can use it as is. I didn’t really notice any difference in startup times between Mail.app and Thunderbird, but I did notice that it was faster at sorting incoming mail by rules and especially at putting the junk mail where it belongs. Thunderbird first loads all the incoming into the inbox and then sorts out junk mail and applies the other sorting rules. With Mail.app I don’t end up waiting for the rules to run before I can start weeding through my mail. I think the biggest thing, though, is that using Mail.app gets me into a position where I can more easily use other tools like the address book and it will, no doubt, facilitate syncing with the iPhone (if I ever get around to taking it out of the box and activating it – but that’s another story for another time.)

Solved: Mail.app folder headaches

February 1st, 2008 by Sjan Evardsson

Well, I finally worked through the issues with Mail.app and mapping the Junk folder. I found the fix for it entirely accidentally – I was going through all the settings and found that changing the setting under Mail > Preferences > Junk Mail > When junk mail arrives from “Mark as junk mail, but leave it in the Inbox” to “Move to the Junk mail folder” was enough to restore the mapping for the Junk mail folder.

I also found that the Drafts folder didn’t exactly disappear, it just doesn’t show up when there are no drafts saved.

While GPGMail for 10.5 still incorrectly reports signatures as not being valid, it is still in beta and sure to improve. So, I guess the week of trying it on has begun.

Technorati Tags: ,

Trying Mail.app again (it’s so very trying)

January 29th, 2008 by Sjan Evardsson

I am trying out Mail.app again – to see if some the issues I had in the past have been corrected in Leopard. Somehow, it just doesn’t seem to work right. I installed GPGMail (which is still beta for Leopard) and mostly got that working, except that for every key in my GPGKeyring it says that the key is invalid and there is no signing date (they all work fine in Enigmail…). Also, I set Mail.app to use the Trash folder for trash and the Sent folder for sent items, the Drafts folder for drafts and the Junk folder for junk mail. Seemed straightforward. Until I shut down Mail.app and reopened it. The trash and sent mail were still correctly mapped, but the Drafts folder was gone and no matter what I tried the Junk folder would not map to junk mail. Thankfully I didn’t have anything in the Drafts folder at the time! What a pain! So any junk mail I get is marked as junk (but I mostly have to do it myself – I am used to Thunderbird catching the majority of the stuff that spamassassin didn’t mark) but it stays in the inbox. That’s because Mail.app doesn’t know that the Junk folder is the junk folder. Even after I tried again (and again, and again) with the Mailbox > Use Folder As > Junk.

If I can get Mail.app to properly map the Drafts and Junk folders again I will likely try it on for a full week or two and see how I feel about it. If I can’t get it over that hurdle, however, forget it.

Technorati Tags: , ,

Leopard – First Run

November 2nd, 2007 by Sjan Evardsson

After waiting all this time for a multi-desktop environment I was excited to get and install my copy of 10.5 today. Even though it isn’t ready for some because of program incompatibilities (sorry, Ted) I hadn’t run across anything to make me think it wasn’t ready for my use. And in truth, there isn’t anything ‘wrong’ with Leopard. It just turns out that I hadn’t gotten the word that I would have to upgrade Parallels to build 5160 in order to use it on Leopard. And since I primarily want the multiple desktops (“Spaces”) to make it easier to run VMs that is in an issue. So, I am downloading the update now. Since it isn’t going to cost me anything to upgrade Parallels, that’s ok. For me, running a VM in full-screen mode while still having access to my Mac desktop is important. While I am at the desk I can do that by hooking up another monitor. When I’m not at the desk, though, that isn’t possible. What I sincerely hope is that I can run my guest OS fullscreen on one desktop while coding on another and browsing on another and wasting time (chatting and playing mindless puzzle games) on the fourth. This was my MO when I was working with VMWare on a Linux machine with XFCE. So, now I plan on doing the same on my Mac. After all, when was the last time a window manager for BSD didn’t have multiple desktops? (Ok, I know, OS X is more than a WM, but you get the drift.)

Technorati Tags: , ,

Apache 2.2.6, PHP 5.2.4 and MySQL 5.0.45 on OS X

September 17th, 2007 by Sjan Evardsson

I got tired of looking for a way to replace the Apache/PHP that Apple packages with OS X (without breaking anything else in the process) so I decided to install Apache 2.2 and PHP5 in their own location to avoid stepping on the Apple package toes.

Since I do a great deal of development again MySQL I needed to install that as well, and figured that I would probably need the GD functionality as well so I grabbed libjpeg and libpng to make those work as well. This is the step-by-step.

(Props to James Pelow and his article from last year, from which I borrowed the configure command lines and configuration modifications, as well as the idea of installing the whole mess in /apache2.)

Download the latest MySQL (I used the package version) from MySQL.

Installation is straightforward following the same methods as any other Mac installer.

Download and install libjpeg and libpng – from Ethan Tira-Thompson (this is also in a Mac installer which contains both libraries in one installer).

Download the latest Apache httpd server (Unix source) from Apache

in the terminal:

tar -xzvf httpd-2.2.6.tar.gz && cd httpd-2.2.6

./configure

--prefix=/apache2

--enable-module=most

--enable-shared=max

make

sudo make install

sudo mkdir /apache2/php

Download the latest PHP from PHP

tar -xzvf php-5.2.4.tar.gz && cd php-5.2.4

./configure

--prefix=/apache2/php

--with-zlib

--with-xml

--with-ldap=/usr

--enable-cli

--with-zlib-dir=/usr

--enable-exif

--enable-ftp

--enable-mbstring

--enable-mbregex

--enable-dbx

--enable-sockets

--with-iodbc=/usr

--with-curl=/usr

--with-mysql=/usr/local/mysql

--with-gd

--with-jpeg-dir=/usr/local

--with-png-dir=/usr/local
--with-apxs2=/apache2/bin/apxsmake

sudo make install

sudo cp php.ini-dist /apache2/php/lib/php.ini

Now to make your Apache2.2 a little more ‘Mac’ – you can point it at the Mac web shared files folder, change the user and group and change the location for user files to match the Mac folder system.

Edit httpd.conf (I use nano, you can use any flat text editor like nano, pico, vi, emacs or even BBedit)

sudo nano -w /apache2/conf/httpd.conf

The changes to httpd.conf I made:
I changed

User daemon
Group daemon

to

User www
Group www

and

DocumentRoot "/apache2/htdocs"

to

DocumentRoot "/Library/WebServer/Documents"

and

<Directory "/apache2/htdocs">

to

<Directory "/Library/WebServer/Documents">

and added

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

DirectoryIndex index.html index.php

Edit httpd-userdir.conf

sudo nano -w /apache2/conf/extra/httpd-userdir.conf

The changes to httpd-userdir.conf I made:
I changed

UserDir public_html

to

UserDir Sites

To start and stop the server:
MySQL comes with a Preference Pane that allows you to start and stop it there. To start and stop Apache you need to first make sure that the default Apache shipped with OS X is stopped.

sudo /apache2/bin/apachectl start
sudo /apache2/bin/apachectl stop

I only ran into one issue, when trying to start the server I ran against the following error message (and no running server, of course):

httpd: Syntax error on line 53 of /apache2/conf/httpd.conf:
Cannot load /apache2/modules/libphp5.so into server:
Library not loaded: /usr/local/mysql/lib/mysql/libmysqlclient.15.dylib
Referenced from: /apache2/modules/libphp5.son  Reason: image not found

To fix this I did the following:

cd /usr/local/mysql/lib
sudo mkdir /usr/local/mysql/lib/mysql

for i in `ls ./l*`; do sudo ln -sf /usr/local/mysql/lib/$i /usr/local/mysql/lib/mysql/$i; done

This creates soft links in the directory that libphp5.so is looking for the MySQL libraries.

Then it started right up! Wheee! (I did a quick test by dropping PhpMyAdmin into the /Library/WebServer/Documents folder and browsed to it – the whole Apache/PHP/MySQL is working correctly)

Technorati Tags: , , ,

Aqua port of OpenOffice.org in alpha release

June 5th, 2007 by Sjan Evardsson

It has been a long time coming, but OpenOffice.org have moved a step closer to a native OS X port. The first development snapshot was released this morning. This is an alpha release, and they warn:

THESE BUILDS SHOULD BE USED AT YOUR OWN RISK FOR TESTING PURPOSES ONLY. THEY MAY CRASH OR CAUSE DATA LOSS.

As with any early development release there are lots of things that don’t work yet, such as printing, exporting to PDF, copy/paste, drang and drop, multiple monitors, etc. That’s to be expected. While I am a little tempted to run the alpha release and provide feedback to the development team, I don’t know that I actually have the time to devote to that sort of endeavor right now. Instead, I think I will jump on the first beta, and install it alongside the X11 version, so that I can chime in on testing at that stage.

For those who are interested, the Mac Porting team have blogs and a news section where you can keep up with development if you wish.

Technorati Tags: ,

Boot Camp + Parallels + XP = Validation Nightmare

April 11th, 2007 by Sjan Evardsson

I have been running XP (WinXP Pro, SP2, retail version) under Parallels for a bit, and decided I wanted to give the Boot Camp with Parallels option a try. After finding some rather lengthy and questionable instructions on moving a Parallels image to a Boot Camp partition I decided to go the clean install route.

I deleted my Parallels XP image (and subsequently ended up wishing I hadn’t) and used the Boot Camp assistant to set up my hard drive and install XP. I got XP set up and running, but had to call Microsoft to get it ‘activated’ since it saw it as a new install. Once that was taken care of I installed Office, and got the same kind of headache there – where the key wouldn’t work, because it said it had been installed on too many machines. I decided to leave that be for the time until I felt like waiting on the MS phone queue again.

I rebooted into OS X and loaded my now ‘active’ and ‘valid’ Windows XP under Parallels. As soon as it booted it gave me the message that I had 3 days to activate it as the hardware had changed significantly and it was no longer valid. I ddn’t feel like fighting it so I closed down Parallels and rebooted into XP where, surprise, I got the 3 day warning again!

So not only does loading the same image in a VM result in XP thinking it isn’t a valid copy, but it changes something in the registry somewhere, so that booting back into natively results in the same thing. I thought the concept of hardware profiles would help with this sort of thing, but apparently not. This is something that MS needs to address sooner rather than later as multicore machines make virtualization more common and loading a native image in a VM becomes a more common way of doing that.

An interesting side note: I got fed up with the whole validation issue and removed the XP partition and re-installed XP under Parallels the same way I did originally. I expected the phone calls for the XP key and the Office key etc, etc – but, it just accepted the keys and validated no questions asked.

Technorati Tags: , , ,

Getting the latest and greatest

April 8th, 2007 by Sjan Evardsson

I love (almost) everything about my new Mac. From a hardware standpoint I am ecstatic. The operating system is very nice (although I wish I could have waited until 10.5 so I could have multiple desktops like every other *nix variant.) The bundled tools are, for the most part, useful and usable – with one exception: the versions of Apache and PHP included.

Sure, there are plenty of people out there hosting on Apache 1.3.x and still plenty more using PHP 4.x – but I’m not one of them. At the very least I need to have a working Apache 2.0.x and PHP 5.x so I can test before deploying on my production server. There are plenty of guides online to add Apache 2.x and/or PHP5, but nothing on replacing the defaults. While I am all ok with testing on multiple versions, the multiple versions I would rather test on would be 2.0.x as default and 2.2.x as the upgradeability testbed.

I’m sure there is a way to do this, I just have to find it …

Technorati Tags: , ,

Looking for replacements

March 31st, 2007 by Sjan Evardsson

While I am loving the new Mac, I am slightly annoyed. I am trying to find tools to replace as many of the Windows tools I use so as to streamline my processes as much as possible. I had hoped to work almost exclusively in Mac and use the WinXP for games and audio work. (Yes, I am aware of the plethora of Mac audio tools, however there are some audio tools that I cannot replace, that are only available for Windows and we have enormous amounts of files, song snippets, loops, etc in those formats – thus the Parallels and WinXP.)

Python development is easy – grab Python and use Idle like I always have (although I would like a ‘beefier’ IDE for py). Java development is also easy – and both have Mac OS X versions.

It seems that for most things there are Mac versions, except one: Homesite. Without a doubt the best HTML/PHP development tool ever is Allaire Macromedia Adobe . While that is the case, runs an ok second, but even so, why haven’t Adobe ported HomeSite to Mac? It’s especially rough for someone like myself that has been using Homesite since it was a $9.99 shareware (version 1 1996). So that one is one that will keep me returning to my WinXP on Parallels.

I would also like to figure out how to do multi-pane file browsing in Mac (like the V-com PowerDesk for Windows.)

——

EDIT:

I found a replacement for PowerDesk – XFolders – very nice!