mac libicu-devel安装

php安装intl扩展的时候报错:
configure: error: Unable to detect ICU prefix or no failed. Please verify ICU install prefix and make sure icu-config works
CentOS下直接执行 yum -y install libicu-devel 即可
然而 Mac下没找到 libicu-devel ,而找到了 icu4c
brew install icu4c 之后,再次 configure intl 仍然报同样的错误
求解,谢谢诸位

阅读 7.5k
2 个回答

安装 intl 扩展报错:
configure: error: Unable to detect ICU prefix or no failed. Please verify ICU install prefix and make sure icu-config works
CentOS解决方案:yum -y install libicu-devel
接着继续安装

mac解决方案:
brew install icu4c(仅仅安装这个,configure的时候依然报同样的错误)
brew link icu4c --force
make的时候报错

In file included from ./intl_convertcpp.h:26:
/usr/local/Cellar/icu4c/59.1/include/unicode/unistr.h:3025:7: error: delegating constructors are permitted only in C++11
      UnicodeString(ConstChar16Ptr(text)) {}
      ^~~~~~~~~~~~~
/usr/local/Cellar/icu4c/59.1/include/unicode/unistr.h:3087:7: error: delegating constructors are permitted only in C++11
      UnicodeString(ConstChar16Ptr(text), length) {}
      ^~~~~~~~~~~~~
/usr/local/Cellar/icu4c/59.1/include/unicode/unistr.h:3180:7: error: delegating constructors are permitted only in C++11
      UnicodeString(Char16Ptr(buffer), buffLength, buffCapacity) {}
···
make: *** [intl_convertcpp.lo] Error 1

解决方案:
打开 /Applications/NMP/src/php-7.1.3/ext/intl/Makefile
搜索 CXXFLAGS = -g -O2 行并添加 -std = c ++ 11

CXX = g++
CXXFLAGS = -g -O2 -std=c++11
CXXFLAGS_CLEAN = $(CXXFLAGS)
重新make,如果修改文件之后,make clean 刚才修改的会被重置

参考:
https://stackoverflow.com/que...
https://gist.github.com/redef...

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题