Installing PHP5 on OSX: Many Paths, One True Road
A week or so ago, I needed to play with some PHP apps on my MacBook Pro. The hosting provider that this may go up on uses PHP5 but OSX comes standard with PHP4. So I decided to install it myself. I thought that this would be an easy task and I was quite wrong.
The Entrophy PHP build looked good. It had some good libraries attached to it and I wouldn’t have to compile anything. So I installed it. The install script worked nicely — I didn’t have edit any configs. It would have been better the Entrophy PHP package would have worked. I don’t know what happened, but I couldn’t get a phpinfo() command to work through the web (it worked fine on the command line). There was no error in the Apache log. It just flat-out didn’t work.
So next I tried the PHP5 build from MacPorts. It built fine, but it didn’t find my MySQL install by default. If I wanted MySQL support, it seemed I have to install MacPorts’ MySQL. But I already had MySQL installed! I could have fussed around with it, I suppose, but I could have compiled it manually by then.
And so installed PHP5 the old-fashioned way: ./configure --with-mysql=/usr/local/mysql; make; sudo make install. Not pretty, not fun, but after editing the httpd.conf things worked.
This whole affair reminded me of DLL conflicts on Windows or RPM dependency woes on Linux. This is the first this has happened to me on OSX. And I hope that it’s not a sign of things to come.
