Michael Gruber
Michael Gruber

Reputation: 601

Linker error from homebrew installing php when running make

I'm attempting to install php and php-cgi with Homebrew.

brew install https://github.com/ampt/homebrew/raw/php/Library/Formula/php.rb

Using this method returns the following errors.

==> make
clang: clangerror: : linker command failed with exit code 1 (use -v to see invocation)error: 
linker command failed with exit code 1 (use -v to see invocation)
make: *** [sapi/cli/php] Error 1
make: *** Waiting for unfinished jobs....
make: *** [sapi/cgi/php-cgi] Error 1

I've updated Homebrew, and the XCode command line tools. The only warning brew doctor gives me is that a few Python "config" scripts exist outside my system or Homebrew directories.

Anyone know what the issue could be? Where can I look for more detailed error messages?

Upvotes: 0

Views: 1221

Answers (2)

alex88
alex88

Reputation: 4918

As a comment on homebrew-php repository just force link libxml2

brew link libxml2 --force

Upvotes: 0

jrwren
jrwren

Reputation: 17898

I'm not familiar with the ampt tap, when I grabbed php I used the josegonzalez tap. You could try that.

$ brew tap josegonzalez/homebrew-php

You can also get more information by using the -vd options to brew install.

$ brew install -vd https://github.com/ampt/homebrew/raw/php/Library/Formula/php.rb

I just unlinked my 5.3.13 php from josegonzalez and ran the above command. With the -vd I can see the ./configure command run and all the output from it as well as the commands make invokes and compiler output. Whew, this is taking a while to build.

It does fail for me with this output

==> cp ./php.ini-production /usr/local/Cellar/php/5.3.10/etc/php.ini
cp ./php.ini-production /usr/local/Cellar/php/5.3.10/etc/php.ini 
cp: /usr/local/Cellar/php/5.3.10/etc/php.ini: No such file or directory
/usr/local/Library/Homebrew/formula.rb:553:in `system

Looks like the Formula never creates ${prefix}/etc. I blame the formula. Try josegonzalez tap.

$ rm /Library/Caches/Homebrew/Formula/php.rb 
$ brew tap jozegonzalez/homebrew-php
$ brew install php53

Upvotes: 1

Related Questions