The biggest and the best in the Northwest

Installing pecl_http on OS X Mavericks (10.9)

After updating to OS X 10.9 I discovered apache wasn’t working correctly. Fixing apache was a simple fix – during the upgrade, the shipping version of Apache and PHP was updated so they installed a new http.config and removed my php.ini.

To get Apache up and running (and configured) again, run a diff of /etc/apache2/httpd.conf (this is the new httpd.conf created by the OS install) and /etc/apache2/httpd.conf.pre-update (this is the backup the installer created of your previous install).

To get PHP back to it’s previous state, copy /etc/php.ini.default (created by OS install) to /etc/php.ini. You can find your previous php ini with a -previous extension in /etc/ (mine was /etc/php.ini-5.2-previous). Do a diff between your old backed up php.ini-5.2.previous and the new php.ini, you’ll find a couple of settings you want to restore in php.ini.

The last headache I had was with pecl_http. I attempted to sudo pecl install pecl_http and I got the error:checking for zlib.h... not found
configure: error: could not find zlib.h
ERROR: `/private/tmp/pear/temp/pecl_http/configure --with-http-curl-requests --with-http-zlib-compression --with-http-magic-mime=no --with-http-shared-deps' failed

This issue was finally solved by updating Xcode to 5.0.1 and then installing “Command Line Tools (OS X Mavericks) for Xcode”. The tricky part is Apple no longer lets you install command line tools from within Xcode – they have a new Downloads for Apple Developers site where you can download and install Command Line Tools (OS X Mavericks) for Xcode. You will need a free Apple Developer account in order to log in and download the command line tools.

After installing the command line tools, sudo pecl install pecl_http worked. I restarted apache and was good to go!