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.