Refusing To Link Macos-provided Software Libiconv

源码包下载地址

下载到本地后解压到一个临时文件夹内,此处没有硬性要求。我一般都是自己新建tmp文件夹,方便存放。(ps:日后如果需要源码安装扩展的话可以直接去源码包的ext目录找到对应扩展内容)

Gem - エラー - refusing to link macos-provided software: libxml2. Yosemite Mac OS X 10.10でnokogiri libiconvのインストールに失敗しました (7) 10.9 on XCode 6.1カスタマイズされたlibxslt が死んでいたので、私は-use-system-librariesを投げなければなりません.

  1. 本书包含了笔者在阅读《Pro Git》过程中记录的详尽笔记。适合有一定Git基础的 读者温故Git知识,也适合正在阅读此书的同仁边读边复习。.
  2. Warning: Refusing to link macOS-provided software: libarchive. Save hide report. 100% Upvoted. Log in or sign up to leave a comment log in sign up.
Libiconv

解压后的源码包如下

安装

编译源码

编译过程常见问题

configure: error: Package requirements (openssl >= 1.0.1) were not met:

原因

没有找到openssl

解决方法

我的openssl是通过brew安装的

强制brew link更新

上面内容大概就是brew不建议这么操作,但是也给出了解决办法,命令行依次执行上面说明需要添加的环境变量

修正对应编译项

configure: error: Cannot locate header file libintl.h

原因

–with-gettext编译报错,没有找到gettext的可执行文件,因为configure文件中gettext的默认path 是 /usr/local/usr

解决方法
找到对应可执行程序路径

如果which gettext没有结果则执行安装

修正对应编译项

configure: error: Please specify the install prefix of iconv with –with-iconv=

原因

–with-iconv编译报错,没有找到iconv的可执行文件,或者系统中没有libiconv

解决方法
找到对应可执行程序路径

or

修正对应编译项

最终编译语句

编译成功后显示

make

make install

Refusing to link macos-provided software libiconv free

编译后指定的php目录

此时需要配置一下ini和php-fpm

测试

创建index.php

Refusing To Link Macos-provided Software Libiconv Windows 10

启动服务(ps:本地并未安装webserver,所以本次测试使用的是php自带的webserver)

打开浏览器访问

php扩展安装

gd

刚刚gd库安装失败了,现在去源码包中重新安装一边

phpize

此步骤编译成功后会生成configure可执行文件

configure

发现错误
  1. 缺少libpng库
  2. brew install libpng安装库后
  3. 重新执行./configure --with-php-config=/Users/shiwenyuan/php/bin/php-config

编译成功后会生成对应的Makefile

make && make install

修改php.ini

重启php服务后访问

I recently had a bit of fun after upgrading to Homebrew v1.9.0, so wanted to write a quick PSA for others who may hit the same issue.

Homebrew >= v1.9.0 has a breaking change to brew link --force:

brew link --force will not link software already provided by macOS.

That is, this change means that Homebrew will no longer allow brew link to override anything MacOS already ships with.

So for example, if you used Homebrew to install a recent version of Ruby, before v1.9.0 Homebrew’s version would’ve been in your path — now the MacOS system version will be in your path:

If you try to brew link it, Homebrew will tell you why it’s refusing to, and give you a snippet of script for prepending it to your PATH in your chosen shell (in my case, fish):

You can also see this information for any given package by running brew info <package>.

Refusing To Link Macos-provided Software Libiconv Pdf

The upgrade to v1.9.0 does not give any warning about this — the change is effectively silent — so beware of scripts depending any binaries that clash with MacOS provided ones being in your default system PATH!