Hacker News new | past | comments | ask | show | jobs | submit login

I was going down the "Maybe I should ditch Mac" thought process last night when I had to recompile PHP on OSX Server (10.6) so that I could enable GD and FreeType. I wish Apple would just leave the sources in the same folders you find them in on linux as I had to hunt through my build flags to figure out why each one could not find the dependencies.

At 2AM I finally was able to do my sudo make install and everything was right with the world again. :)




PHP's build system has an awesome feature: every one of the included extensions can also be built stand-alone. There is no difference between an external and a bundled library.

So to add a bundled library to the mac's PHP, you download the PHP sources (most of the time, not even the version has to match) and you extract them.

Then you cd into ext/<name of extension> and type phpize, followed by configure and make install.

Now you can enable the freshly built and correctly installed extension in your php.ini.

No need to replace the system PHP with something home-grown.


This sort of thing led me to doing all development on a per-project Linux virtual machine. I started by using various development stacks (LAMP, LEPP, whatever) running under VMWare Fusion, using appliances from http://www.turnkeylinux.org/ or http://bitnami.org/. Then I discovered Vagrant (http://vagrantup.com/), which is a nice command-line driven tool for managing and provisioning base images. I use it for everything now.

You can run Lion virtualized under OS X, if you are so inclined, but I don't see any advantage to doing so.

I like the isolation of environments so much that even if I were to switch to Linux as my day to day OS, I would still develop every project in a VM.


You should use MacPorts or Homebrew - Googling suggests that Homebrew at least specifically supports php with freetype.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: