Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Installation fails on OS X Mavericks #591

Closed
paulmillr opened this Issue · 29 comments
@paulmillr

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

etc

OS X Version: 10.9.0
Homebrew Version: 0.9.4
XCode Version: 5.0
CLI tools: installed
gcc: Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1 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.

@termleech

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).

@Jeraimee

Same issue when using Xcode5-DP

@itafroma

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
@Jeraimee

For me it was:

sudo ln -s /Applications/Xcode5-DP.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include /usr/include

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

@clemensg

For now, you could apply this patch to your local homebrew repo: https://github.com/mxcl/homebrew/pull/20499.patch

See Homebrew/homebrew#20499

And before you do that, remove your symlink.

@paulmillr

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

@clemensg

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..

@paulmillr

I think it’s mavericks-only

@itafroma

With Homebrew/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.

@paulmillr

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

@clemensg

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"

@itafroma

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/Xcode5-DP.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib,
          headers    /Applications/Xcode5-DP.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include
checking for odbc.h in /Applications/Xcode5-DP.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include... no
checking for odbcsdk.h in /Applications/Xcode5-DP.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include... no
checking for iodbc.h in /Applications/Xcode5-DP.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include... no
checking for sqlunix.h in /Applications/Xcode5-DP.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include... no
checking for sqltypes.h in /Applications/Xcode5-DP.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include... no
checking for sqlucode.h in /Applications/Xcode5-DP.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include... no
checking for sql.h in /Applications/Xcode5-DP.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include... no
checking for isql.h in /Applications/Xcode5-DP.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include... no
checking for sqlext.h in /Applications/Xcode5-DP.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include... no
checking for isqlext.h in /Applications/Xcode5-DP.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include... no
checking for udbcext.h in /Applications/Xcode5-DP.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include... no
checking for sqlcli1.h in /Applications/Xcode5-DP.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include... no
checking for LibraryManager.h in /Applications/Xcode5-DP.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include... no
checking for cli0core.h in /Applications/Xcode5-DP.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include... no
checking for cli0ext.h in /Applications/Xcode5-DP.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include... no
checking for cli0cli.h in /Applications/Xcode5-DP.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include... no
checking for cli0defs.h in /Applications/Xcode5-DP.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include... no
checking for cli0env.h in /Applications/Xcode5-DP.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include... no
configure: error: Cannot find header file(s) for pdo_odbc
@itafroma

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.

@itafroma

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.

@clemensg

Interesting, because readline.h does exist in /Applications/Xcode5-DP.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/readline
which is
#{MacOS.sdk_path}/usr/include/readline

Something must be missing..

Did you try using Homebrew's readline?

@itafroma

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.

@itafroma

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: https://gist.github.com/itafroma/5821674
And the PHP 5.3 PEAR errors: https://gist.github.com/itafroma/5821794

@rnhmjoj rnhmjoj referenced this issue in yyuu/pyenv
Closed

Build failed on Mac OS X 10.9 #25

@denji

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
Closed

Mavericks compatibility #72

79 of 111 tasks complete
@magazov

that helped for me:

sudo ln -s /Applications/Xcode5-DP.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include /usr/include
brew install unixodbc
brew install php55 --with-fpm --without-apache --with-tidy --with-unixodbc
@denji

@magazov

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
@itafroma

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

@kungfuchicken

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

@jmoz

@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
@terion-name

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

@clemensg

@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!)

@terion-name

@clemensg
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:
https://gist.github.com/terion-name/325010b5c35b50c8ab8c

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 :frowning:

@zhao5908

for me it works

sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/ /usr/include
brew install php55
@mralexho

@zhao5908 this worked for me too. Thanks.

@huangsong

xcode-select --install

@lucasmichot lucasmichot locked and limited conversation to collaborators
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Something went wrong with that request. Please try again.