更新osx 10.11后,删除自带php版本,重新编译php 5.5.29,到make阶段提示错误。

发布于 2022-09-01 22:58:10 字数 2975 浏览 16 评论 0

配置命令:
--prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --sysconfdir=/private/etc --with-apxs2=/usr/sbin/apxs --enable-cli --with-config-file-path=/etc --with-config-file-scan-dir=/Library/Server/Web/Config/php --with-libxml-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr --with-zlib-dir=/usr/lib --enable-bcmath --with-bz2 --enable-calendar --disable-cgi --with-curl=/usr/local/curl --enable-exif --enable-fpm --enable-ftp --with-png-dir --with-gd --with-jpeg-dir=/BinaryCache/apache_mod_php/apache_mod_php-95~11/Root/usr/local --enable-gd-native-ttf --with-icu-dir=/usr --enable-mbstring --enable-mbregex --with-mysql=mysqlnd --with-mysqli=mysqlnd --without-pear --with-pear=no --with-pdo-mysql=mysqlnd --with-mysql-sock=/var/mysql/mysql.sock --enable-shmop --with-snmp=/usr --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-xmlrpc --with-iconv=/usr/lib --with-xsl=/usr --enable-zip --with-freetype-dir=/usr/local/lib

配置完成的提示:
Thank you for using PHP.

config.status: creating php5.spec
config.status: creating main/build-defs.h
config.status: creating scripts/phpize
config.status: creating scripts/man1/phpize.1
config.status: creating scripts/php-config
config.status: creating scripts/man1/php-config.1
config.status: creating sapi/cli/php.1
config.status: creating sapi/fpm/php-fpm.conf
config.status: creating sapi/fpm/init.d.php-fpm
config.status: creating sapi/fpm/php-fpm.service
config.status: creating sapi/fpm/php-fpm.8
config.status: creating sapi/fpm/status.html
config.status: creating ext/phar/phar.1
config.status: creating ext/phar/phar.phar.1
config.status: creating main/php_config.h
config.status: executing default commands

make 编译时提示的错误:
Undefined symbols for architecture x86_64:
"_libiconv", referenced from:

  _do_convert in gdkanji.o
  _zif_iconv_substr in iconv.o
  _zif_iconv_mime_encode in iconv.o
  _php_iconv_string in iconv.o
  __php_iconv_strlen in iconv.o
  __php_iconv_strpos in iconv.o
  __php_iconv_appendl in iconv.o
  ...

"_libiconv_close", referenced from:

  _do_convert in gdkanji.o
  _zif_iconv_substr in iconv.o
  _zif_iconv_mime_encode in iconv.o
  _php_iconv_string in iconv.o
  __php_iconv_strlen in iconv.o
  __php_iconv_strpos in iconv.o
  __php_iconv_mime_decode in iconv.o
  ...

"_libiconv_open", referenced from:

  _do_convert in gdkanji.o
  _zif_iconv_substr in iconv.o
  _zif_iconv_mime_encode in iconv.o
  _php_iconv_string in iconv.o
  __php_iconv_strlen in iconv.o
  __php_iconv_strpos in iconv.o
  __php_iconv_mime_decode in iconv.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: * [libs/libphp5.bundle] Error 1

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

┼── 2022-09-08 22:58:10

iconv不要重新编译,用系统自带的,新版和旧版头文件不一样,会报错!

嗼ふ静 2022-09-08 22:58:10

你有用homebrew么?还是有特殊的原因需要自己编译?不然感觉还是用homebrew在Mac下来管理开发的依赖好一点:)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文