I have upgraded a Mac to macOS 10.12.0 Sierra, and am trying to upgrade PHP to version 7.0.9, but 'make test' fails with:
Undefined symbols for architecture x86_64:
"_libiconv", referenced from:
_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
_php_iconv_stream_filter_append_bucket in iconv.o
...
"_libiconv_close", referenced from:
_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
_php_iconv_stream_filter_factory_create in iconv.o
...
"_libiconv_open", referenced from:
_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
_php_iconv_stream_filter_factory_create 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/libphp7.bundle] Error 1
I compiled it with:
./configure --prefix=/usr/local/php5 --mandir=/usr/share/man --infodir=/usr/share/info --sysconfdir=/etc --with-config-file-path=/etc --with-zlib --with-zlib-dir=/usr --with-openssl=/usr/local --enable-exif --enable-ftp --enable-mbstring --enable-mbregex --enable-sockets --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-apxs2=/usr/local/apache2/bin/apxs --enable-zip --with-curl
and have tried adding different '--with-iconv-dir=' options but always get the same undefined symbols error.
I have downloaded and compiled libiconv to no avail. Even configured the compile with:
CFLAGS='-arch x86_64' CCFLAGS='-arch x86_64' CXXFLAGS='-arch x86_64' ./configure
but that made no difference. Any suggestions?
Any help would be much appreciated.
This might solve the problem
vim Makefile
find EXTRA_LDFALGS and EXTRA_LDFLAGS_PROGRAMS
remove L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/lib
(libiconv will install in /usr/local/opt/libiconv/)
-liconv
to /usr/local/opt/libiconv/lib/libiconv.dylib
Here is the reason:
libiconv.dylib
in dir/usr/lib/libiconv.dylib
, which do not
contains _libiconv _libiconv_close . founctions
. Update to a new libiconv version and reference to it will solve the case If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With