Josh Schumacher: A PHP Developer

The biggest and the best in the Northwest

Josh Schumacher: A PHP Developer random header image

Installing pecl_http on OS X Mavericks (10.9)

October 23rd, 2013 · 1 Comment

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!

Tags: Uncategorized

1 response so far ↓

  • 1 Jared // Nov 8, 2013 at 10:34 am

    I followed your directions above because I was having the same issue installing pecl_http but I got a different outcome. After updating Xcode and installing command line tools I get this error.

    Could not open input file: /usr/lib/php/peclcmd.php

    I changed directories to that location and the file does not exist. Any thoughts?

Leave a Comment