Homebrew install errors in OSX El Capitan? Here's a solution

Learn how to fix homebrew install errors for PHP in OSX El Capitan Developer Preview

Homebrew install errors in OSX El Capitan? Here's a solution

I've been playing with OSX El Capitan Developer Preview for the past few days, and aside from a few little problems, it's been great so far. The sticking point was homebrew and installing new packages.

[![El Capitan Homebrew inEl Capitan Homebrew install errorsme/content/images/2015/07/Screen-Shot-2015-07-12-at-12.37.06.png?ssl=1)

I was trying to install PHP 5.4 on my local machine, and kept getting the following error:

checking whether we are cross compiling... configure: error: in '/private/tmp/xz20150712-4864-11g36o9/xz-5.2.1': configure: error: cannot run C compiled programs. If you meant to cross compile, use '--host'. See 'config.log' for more details

Fixing the issue

I did the usual of googling for a solution, and the suggestions I came across were to do with the file system. I knew nothing had changed here, so kept digging and looking for a solution.

After running brew doctor, it moaned about xCode being out of date. As the issue was to do with C compiled programs not running, I assumed that the issue was related to xCode. I ran:

xcode-select --install

After waiting for the installer to finish, everything ran smoothly with installing PHP with homebrew. Hope this helps you save time and effort!