MacPorts and php53-apache2handler

Ok, this one slipped right by me. 

I was working on a project and added LDAP functionality to my PHP build and…. it the extension wasn’t loading! Blast!

Hmmm. After solving the problem I had I went back and did a little digging to figure out what the heck was going on. 

I checked Apache’s modules and noted that the file was from 2013. That told me that the php was not being compiled.

I discovered that I need to run this command in terminal, ‘php53-apache2handler’ after installing PHP 5.3. This then triggered the compile. 

It appears that the ‘php53’ port file doesn’t support the ‘+apache2’ command. Hence the need to run this command: 

sudo port install php53-apache2handler

In my case I had to remove this reference in the httpd.conf file: 

LoadModule php5_module modules/

and replace it with: 

LoadModule php5_module modules/

Note that the command will also present you with the command to modify the httpd.conf file accordingly but will not remove the old reference. 

Guess I’m going to have to install from scratch at some point and document that. 



Mountain Lion and my MacPorts installations

I decided to take the Mac Mini I use for testing and upgrade to Mac OS X 10.8 and see if Enterprise would have any problems. The machine was previously on Mac OS X 10.6.8. So I did the old clone thing…just in case…and away I went.

Obviously this requires not only upgrading the machine but upgrading Xcode.

The result? So far so good. Everything works fine. This is a case where the result was exactly what I expected. I didn’t compile anything…just a straight upgrade.

The next step will be to remove all the parts and re-install them using MacPorts. It appears that, as of February, quite a few ports were broken (see here: Note that the author also gives steps on how to fix the broken port issues so it should be an adventure.

The one thing that I really want to do is to have two distinct installations of Apache2/PHP. In this case it would be one for Enterprise 7 and one for Enterprise 8.

I’ll document what I’m up to and post away.

MySQL55 and MacPorts – problem when starting MySQL55

I’ve been fighting a problem with my installation of MySQL55. As you may know I have used MacPorts to install the whole stack that I use.

When trying to start MySQL55 I would get an error in Terminal with text like this:

Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed
syntax error near unexpected token `then’ mysql
Etc, Etc.

A bit frustrating.

I found this bug report on the MacPorts site 40040

So, to fix this I followed the first entry’s suggestion:

1. Navigate to this file: /opt/local/lib/mysql55/bin/mysqld_safe

2. Open the file in text editor and go to line 724. It will look like this:

then # The pid contains a mysqld process
The information after the ‘if’ statement is missing. It should look like this:

if “ps -ef | grep -v mysqld_safe | grep — $MYSQLD | grep $PID > /dev/null”
then # The pid contains a mysqld process
Now go back to Terminal and issue the command:

/opt/local/lib/mysql55/bin/mysqld_safe &
MySQL55 should now start.

MacPorts and Mac OS X 10.9

Update: Twitter user @neverpanic noted that if I had issued this command:

sudo xcodebuild –license
after the ‘sudo xcode-select –install’ command that would have fixed things up so that the ‘self update’ would not have failed.


I needed to make a change to MacPorts today and ran into a problem where MacPorts (when invoked from the Terminal) would throw the following error:

Error: /opt/local/bin/port: port selfupdate failed: Error installing new MacPorts base: command execution failed


The update to Mavericks blew out my Xcode command tools installation. (or it needed to be updated…)

You can either go to Xcode and install the tools or run this command:

sudo xcode-select –install
Now, in Terminal, try this command

sudo port selfupdate
In my case it failed…again.

I then went and started Xcode and started the application and the install seemed to finish.

I then ran the above command again to update MacPorts and this time it completed successfully.

MacPorts error “Mac Ports upgrade error Can’t map the URL”

Was upgrading one of my machines to the latest and greatest using MacPorts.

When I ran this command:

sudo port upgrade

I got this error:

Mac Ports upgrade error Can’t map the URL ‘file://.’ to a port description file (“Could not find Portfile in /”)

Odd. Hadn’t seen that one before.

A little digging around led to this solution. Run this command:

sudo port upgrade outdated

Problem solved!