-
Notifications
You must be signed in to change notification settings - Fork 363
Trouble Shooting: Can't build PHP on OS X El Capitan
If you encountered the error like below:
_readline_shell_run in readline_cli.o
"_history_list", referenced from:
_zif_readline_list_history in readline.o
"_rl_mark", referenced from:
_zif_readline_info in readline.o
"_rl_pending_input", referenced from:
_zif_readline_info in readline.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [sapi/cli/php] Error 1
Here is an answer from @augustohp:
You should be careful when upgrading to a major version if you want to keep compiling stuff, everything will break specially after heart bleed when Apple solely decided they are better patching openssl
and curl
by themselves.
Your trace is not useful at all, you did not give the root cause of the link error (just the end of it) but as I said, it is probably curl
or openssl
(or libxml2
). Given the lack of information you will have to try everything that comes up to my mind:
- Update XCode tools with
xcode-select --install
, if that doesn't work (it rarely does), download it manually. - Install/Upgrade homebrew formulas:
-
brew update
to update formulas. - Re-tap homebrew/php so we get their dependencies
brew tap homebrew/php --repair
. - Install all formulas listed on
brew deps homebrew/php/php56 --with-gmp
. - Upgrade previously installed formulas with
brew upgrade
.
-
- You will probably have to force link some dependencies (you can link them elsewhere too, probably better but you need to specify the path on the variants):
- Link them with
brew link --force iconv
. - Some I know you will have to:
libxml2
,curl
,icu4c
.
- Link them with
I really don't know what will help you, but I have all last versions since 5.3
compiled under El Capitan using phpbrew, haven't tried 7.0
(though doing that now), so I know it works.
PS: Make sure you install a new version with --test
😄
PPS: I am sorry if you use macports.