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 install errors

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!

Ste

Web Developer living in Manchester, working for Studio Skylab (http://www.studioskylab.com). Views and thoughts are my own.

You may also like...

3 Responses

  1. Mike says:

    Thanks! Just encountered this and your tip fixed the problem. Cheers!

  2. Robert says:

    I also had to install XCODE since I had it before…brew was complaining still and I read it was a mismatch between the .app and the command line tools.

Leave a Reply