Hello,
I'm trying to install php with iconv, but I get errors. My system says I have iconv installed:
$ which iconv
/usr/bin/iconv
The error seems to indicate that I should specify the path to iconv, but I can't see how I can do that with phpbrew.
phpbrew --debug install 5.6.30 +iconv
===> phpbrew will now build 5.6.30
---> Parsing variants from command arguments '+iconv'
===> Loading and resolving variants...
Checking distribution checksum...
Checksum matched: 67566191957b5fcac8567a5a9bbdced7
===> Distribution file was successfully extracted, skipping...
Source Directory: /Users/user/.phpbrew/build/php-5.6.30
Found existing Makefile, running make clean to ensure everything will be rebuilt.
You can append --no-clean option after the install command if you don't want to rebuild.
===> Running make clean: /usr/bin/make -C '/Users/user/.phpbrew/build/php-5.6.30' --quiet 'clean'
Running Command:/usr/bin/make -C '/Users/user/.phpbrew/build/php-5.6.30' --quiet 'clean'
Writing variant info to /Users/user/.phpbrew/php/php-5.6.30/phpbrew.variants
===> Checking patches...
Checking patch for replace apache php module name with custom version name
Enabled variants: [iconv, xml, opcache]
Disabled variants: []
Found existing build.log, renaming it to /Users/user/.phpbrew/build/php-5.6.30/build.log.1491257869
===> Configuring 5.6.30...
Use tail command to see what's going on:
$ tail -F /Users/user/.phpbrew/build/php-5.6.30/build.log
./configure '--cache-file='\''/Users/user/.phpbrew/cache/config.cache'\''' '--prefix=/Users/user/.phpbrew/php/php-5.6.30' '--with-config-file-path=/Users/user/.phpbrew/php/php-5.6.30/etc' '--with-config-file-scan-dir=/Users/user/.phpbrew/php/php-5.6.30/var/db' '--disable-all' '--enable-phar' '--enable-session' '--enable-short-tags' '--enable-tokenizer' '--with-pcre-regex' '--with-iconv' '--enable-dom' '--enable-libxml' '--enable-simplexml' '--enable-xml' '--enable-xmlreader' '--enable-xmlwriter' '--with-xsl' '--with-libxml-dir=/Users/user/homebrew/opt/libxml2' '--enable-opcache' '--with-pear=/Users/user/.phpbrew/php/php-5.6.30/lib/php' >> /Users/user/.phpbrew/build/php-5.6.30/build.log 2>&1
Error: Configure failed:
The last 5 lines in the log file:
checking whether to enable hash support... no
checking for iconv support... yes
checking for iconv... no
checking for libiconv... no
configure: error: Please specify the install prefix of iconv with --with-iconv=<DIR>
Please checkout the build log file for more details:
tail /Users/user/.phpbrew/build/php-5.6.30/build.log
PHP gets installed correctly
Paste your phpbrew install command here (be sure to install with --debug flag, e.g. phpbrew --debug install)
phpbrew --debug install 5.6.30 +iconv
OS:
OS X 10.12.3
to build php, you need both the binary files and header files.
in your case, /usr/bin/iconv is just the binary file, and you need to install the header files (see https://www.gnu.org/software/libiconv/ ) / specify the path to head files.
thanks!
@jhdxr emmmmm我说中文吧
同样这个问题,也是一直报reinstall iconv library
这个header文件iconv.h我这边好像能找到 但是官网说的一个libiconv.so文件我这边找不到 自己重装的iconv 是这个so文件的问题么?官网说so文件和头文件是一起安装的 但是没找到
So for short just run brew install libiconv
and +iconv=/usr/local/opt/libiconv
For those people who install iconv via phpbrew ext install:
phpbrew ext install iconv -- --with-iconv=/usr/local/opt/libiconv
Most helpful comment
For those people who install iconv via
phpbrew ext install: