Installation fails on OS X Mavericks #591

paulmillr opened this Issue Jun 13, 2013 · 29 comments


None yet

brew install -v php54 --with-cgi fails.

  • Simply: Error is configure: error: Cannot find OpenSSL's <evp.h>.
  • --with-homebrew-openssl: checking for BZip2 in default path... not found
  • --with-homebrew-openssl --without-bzip2: checking for cURL in default path... not found


OS X Version: 10.9.0
Homebrew Version: 0.9.4
XCode Version: 5.0
CLI tools: installed
gcc: Configured with: --prefix=/Applications/ --with-gxx-include-dir=/Applications/ Apple LLVM version 5.0 (clang-500.1.58) (based on LLVM 3.3svn) Target: x86_64-apple-darwin13.0.0 Thread model: posix
php -v: PHP 5.3.23 with Suhosin-Patch (cli) (built: May 22 2013 00:00:34)

brew doctor is cool.

I think the problem is that the includes it needs are located (assuming you installed the command line tools) and /Library/Developer/CommandLineTools/SDKs/MacOSX10.9.sdk/usr/include/ However I don't know how to link them in (been trying to figure it out).

Same issue when using Xcode5-DP


Homebrew is working on a fix for the lack of /usr/include in 10.9, but a stopgap fix is to use a symlink:

ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX10.9.sdk/usr/include/ /usr/include

This fixes the missing evp.h error, but it creates a new one:

configure: error: Cannot find header file(s) for pdo_odbc

For me it was:

sudo ln -s /Applications/ /usr/include

But, in the end - same second error about pdo_odbc. Will research.

For now, you could apply this patch to your local homebrew repo:

See Homebrew/legacy-homebrew#20499

And before you do that, remove your symlink.

same, does not work, same error with 20499 and 20524

I tried to build it myself and it failed. I am not sure if this is a Mavericks-only issue, are you?

With --with-homebrew-openssl the OpenSSL checks pass, but there is yet another error:
checking for BZip2 support... yes
checking for BZip2 in default path... not found
configure: error: Please reinstall the BZip2 distribution``

I'll try to investigate further later..

I think it’s mavericks-only


With Homebrew/legacy-homebrew#20524, I get the same error as clemensg. If you don't get that error and get the same stuff you were getting without the patch, it's probably because you didn't remove the symlink to /usr/include I mentioned in an earlier comment.

You can bypass the BZip2 error by using --without-bz2, but then you'll get a similar error for cURL. Looking at the formula, I think the problem is that most of the extensions are hardcoded to use /usr as the prefix in abstract-php.rb. OpenSSL doesn't suffer from this because it checks for Homebrew's prefix when using --with-homebrew-openssl.

Unfortunately, I don't know enough about Homebrew to suggest a PR: I guess another stopgap fix would be to adjust all those hardcoded references.

yeah right, i’ve mentioned this in the issue description. some header shit is messed up

You definitely have to adjust those hardcoded references /usr in abstract-php.rb because on Mavericks there is no /usr/include etc. it's all in the Xcode SDK path.

Please try the following: Replace "/usr" with "#{MacOS.sdk_path}/usr"


That's definitely working, thanks! I've been adjusting paths as I get the errors, but I've hit a wall on:

checking for PDO includes... (cached) /private/tmp/php54-W9Wi/php-5.4.15/ext
checking for selected PDO ODBC flavour... generic-iodbc
          libs       /Applications/,
          headers    /Applications/
checking for odbc.h in /Applications/ no
checking for odbcsdk.h in /Applications/ no
checking for iodbc.h in /Applications/ no
checking for sqlunix.h in /Applications/ no
checking for sqltypes.h in /Applications/ no
checking for sqlucode.h in /Applications/ no
checking for sql.h in /Applications/ no
checking for isql.h in /Applications/ no
checking for sqlext.h in /Applications/ no
checking for isqlext.h in /Applications/ no
checking for udbcext.h in /Applications/ no
checking for sqlcli1.h in /Applications/ no
checking for LibraryManager.h in /Applications/ no
checking for cli0core.h in /Applications/ no
checking for cli0ext.h in /Applications/ no
checking for cli0cli.h in /Applications/ no
checking for cli0defs.h in /Applications/ no
checking for cli0env.h in /Applications/ no
configure: error: Cannot find header file(s) for pdo_odbc

I just attached where I'm at above: I might've missed a prefix somewhere, but I can't tell. Just a WIP, though: besides the PDO issue I mentioned, there's likely other prefixes that need to be changed and there needs to be checks for OS X version.


OK, I was able to spend some more time on this, and got past the ODBC error. The problem is that neither Xcode nor the CLT include any of the headers required for pdo_odbc. However, if you brew install unixodbc and run brew install php54 --with-unixodbc, it will continue on. So it looks like unixodbc is now a dependency under 10.9.

Unfortunately, I'm still not able to build. Where I'm stuck now is on readline support:

checking for libedit readline replacement... yes
configure: error: Please reinstall libedit - I cannot find readline.h

Xcode/CLT does include readline.h in #{MacOS.sdk_path}/usr/include/readline, but adding --with-readline=#{MacOS.sdk_path}/usr/include/readline, --with-readline=#{MacOS.sdk_path}/usr/include, or --with-readline=#{MacOS.sdk_path}/usr to the install args in abstract-php.rb has no effect.

Interesting, because readline.h does exist in /Applications/
which is

Something must be missing..

Did you try using Homebrew's readline?


I tried that, same issue. Very strange. The configure line does show the correct expansion (e.g., --with-readline=/usr/local/opt/readline/include/readline) but still fails.

I've attached my WIP patch here again above: it has the ODBC fix and a stab at a readline fix, but the readline code has no effect.


All right, success! I was able to build PHP 5.3 and 5.4 on Mavericks. The issue with readline was that I was using the wrong install arg: it should've been --with-libedit=#{MacOS.sdk_path}/usr.

With that fixed, brew install php53 and brew install php54 still fail, but brew install php53 --without-apache --without-pear and brew install php54 --without-apache work.

Here's the gist of the apache build errors I'm getting:
And the PHP 5.3 PEAR errors:

denji commented Jul 5, 2013

brew install php53 --without-apache

without unixodbc [BUG]

checking for MySQL UNIX socket location... /tmp/mysql.sock
checking for MySQLi support... yes
checking whether to enable embedded MySQLi support... no
checking for Oracle Database OCI8 support... no
checking for unixODBC support... configure: error: ODBC header file '/usr/local/opt/unixodbc/include/sqlext.h' not found!
@roderik roderik referenced this issue in kitchenplan/chef-applications Jul 10, 2013

Mavericks compatibility #72

79 of 111 tasks complete
magazov commented Jul 23, 2013

that helped for me:

sudo ln -s /Applications/ /usr/include
brew install unixodbc
brew install php55 --with-fpm --without-apache --with-tidy --with-unixodbc
denji commented Jul 23, 2013


need fix path on Formula/abstract-php.rb

- depends_on 'unixodbc' => :optional
+ depends_on 'unixodbc' => if build.include? 'with-unixodbc'

+ #{MacOS.sdk_path}/usr/include

@magazov check out PR #597 which includes the unixodbc fix. php5* builds with Apache as of DP4.

FYI: The fix provided by @sirn here: Homebrew/legacy-homebrew#20431 (comment) got me installing php53 on 10.9 without any extra effort.

jmoz commented Oct 24, 2013

@kungfuchicken +1

xcode-select --install

This fixes and allows brew install php55 --with-fpm

I then had to run brew link --overwrite php55

@ablyler ablyler closed this Feb 8, 2014

Had the same issue (configure: error: Cannot find OpenSSL's <evp.h>)
This worked
brew install php55 --with-apache --with-fpm --with-homebrew-openssl=#{MacOS.sdk_path}/usr --with-thread-safety

@terion-name Did you try brew install php55 --with-apache --with-fpm --with-homebrew-openssl --with-thread-safety or brew install php55 --with-apache --with-fpm --with-thread-safety ? When did this error occur?
Please post the verbose output from brew install -v ... and brew --config (Gist!)

I'v tried brew install php55 --with-apache --with-fpm --with-homebrew-openssl --with-thread-safety and this failed with configure: error: Cannot find OpenSSL's <evp.h>
After reading this issue comments I've added =#{MacOS.sdk_path}/usr to openssl, and this confog set (brew install php55 --with-apache --with-fpm --with-homebrew-openssl=#{MacOS.sdk_path}/usr --with-thread-safety) worked.

Also there was a problem with IMAP, but it is beyond this issue.

brew --config output:

brew install -v output is senseless, because after brew rm php55 and rerun brew install php55 --with-apache --with-fpm --with-homebrew-openssl --with-thread-safety — it worked 😦

for me it works

sudo ln -s /Applications/ /usr/include
brew install php55

@zhao5908 this worked for me too. Thanks.

xcode-select --install

@lucasmichot lucasmichot locked and limited conversation to collaborators Jun 22, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.