Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure: error: Could not find libpcre.(a|so) in /usr/local #149

Closed
alanhartless opened this issue Dec 8, 2013 · 40 comments

Comments

@alanhartless
Copy link

commented Dec 8, 2013

I can't seem to get php 5.4.22 compiled. It errors out with:

configure: error: Could not find libpcre.(a|so) in /usr/local

PCRE and dev libraries are installed both via apt-get and I tried compiling it myself. But still no love.

find /usr/ -name "libpcre.so"
/usr/lib/i386-linux-gnu/libpcre.so
/usr/local/lib/libpcre.so

find /usr/ -name "pcre.h"
/usr/include/php5/ext/pcre/pcrelib/pcre.h
/usr/include/pcre.h
/usr/local/include/pcre.h

I'm on
Ubuntu 12.04 32bit
phpbrew - 1.11.2
cliframework core: 1.5.12

I've been able to install other versions of php before. I did upgrade phpbrew but not sure from what version as I didn't check prior to running self update. Not sure why its not working now.

Any thoughts? What would I need to provide to help trouble shoot this?

Thanks,
Alan

@c9s

This comment has been minimized.

Copy link
Member

commented Dec 8, 2013

Hi can you run phpbrew with debug flag to show me the configure commands?

e.g.,

    phpbrew -d install 5.4.22 +....
@c9s

This comment has been minimized.

Copy link
Member

commented Dec 8, 2013

The configure script found your pcre.h in /usr/local/include, but it seems like can't get the location of your pcre.so or pcre.a file.

@c9s

This comment has been minimized.

Copy link
Member

commented Dec 8, 2013

You may also try:

   phpbrew lookup-prefix /usr

Then reinstall your php? phpbrew can look up the correct path for you.

@c9s

This comment has been minimized.

Copy link
Member

commented Dec 8, 2013

OK I just fix the libdir detection at 8eb9bc0, please run self-update to get 1.11.3

@alanhartless

This comment has been minimized.

Copy link
Author

commented Dec 8, 2013

Oops; I did self update and it must have overwrote itself with webpage output:

root@server:/home/alan# phpbrew
/usr/bin/phpbrew: line 1: syntax error near unexpected token newline' /usr/bin/phpbrew: line 1:'
root@server:/home/alan# pico /usr/bin/phpbrew

GNU nano 2.2.6 File: /usr/bin/phpbrew

<title>Page not found · GitHub</title> <style type="text/css" media="screen"> body { background-color: #f1f1f1; margin: 0; ...

Gotta grab it again. :-)

@alanhartless

This comment has been minimized.

Copy link
Author

commented Dec 8, 2013

Okay; snagged it again. But it still stays version 1.11.2?

@alanhartless

This comment has been minimized.

Copy link
Author

commented Dec 8, 2013

(after a self-update)

@c9s

This comment has been minimized.

Copy link
Member

commented Dec 8, 2013

autoscript didn't bump the version, but I think it's the latest one.

will fix the version name and self-update later.

@alanhartless

This comment has been minimized.

Copy link
Author

commented Dec 8, 2013

I ran phpbrew lookup-prefix /usr and now I'm getting a message that I must reinstall iconv.

root@server:/home/alan# phpbrew -d install php-5.4.22 +default +mysql +gettext +mcrypt +intl +iconv +ftp +exif +dba +openssl +soap +ipv6 +imap +debug +cgi +apxs2=/usr/bin/apxs2 -- --with-libdir=lib/i386-linux-gnu --with-gd=shared --enable-gd-native-ttf --with-jpeg-dir=/usr --with-png-dir=/usr --enable-wddx --with-mysql-sock=/var/run/mysqld/mysqld.sock --with-freetype-dir=/usr/include/freetype2/freetype --with-openssl
===> Downloading from http://www.php.net/get/php-5.4.22.tar.bz2/from/this/mirror
--2013-12-08 05:55:35-- http://www.php.net/get/php-5.4.22.tar.bz2/from/this/mirror
Resolving www.php.net (www.php.net)... 72.52.91.14
Connecting to www.php.net (www.php.net)|72.52.91.14|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://www.php.net/distributions/php-5.4.22.tar.bz2 [following]
--2013-12-08 05:55:35-- http://www.php.net/distributions/php-5.4.22.tar.bz2
Reusing existing connection to www.php.net:80.
HTTP request sent, awaiting response... 416 Requested Range Not Satisfiable

The file is already fully retrieved; nothing to do.

===> php-5.4.22.tar.bz2 downloaded.
Found existing php-5.4.22, Skip extracting.
Writing variant info to /opt/phpbrew/php/php-5.4.22/phpbrew.variants
Build Directory: /opt/phpbrew/build/php-5.4.22
PHP Version lower than 5.4.0 can only build one SAPI at the same time.
+apxs2 is in conflict with cgi
Disabling cgi
PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, function '--enable-cgi' not found or invalid function name in phar:///usr/bin/phpbrew/PhpBrew/VariantBuilder.php on line 2

Warning: call_user_func_array() expects parameter 1 to be a valid callback, function '--enable-cgi' not found or invalid function name in phar:///usr/bin/phpbrew/PhpBrew/VariantBuilder.php on line 2
Enabled variants: mysql, gettext, mcrypt, intl, iconv, ftp, exif, dba, openssl, soap, ipv6, imap, debug, cgi, apxs2, bcmath, bz2, calendar, cli, ctype, dom, fileinfo, filter, ipc, json, mbregex, mbstring, mhash, pcntl, pcre, pdo, phar, posix, readline, sockets, tokenizer, xml_all, curl, zip
Disabled variants: cgi
===> Applying patch file for freetype include path bug...
patching file configure
Hunk #1 succeeded at 39388 (offset 175 lines).
patch unexpectedly ends in middle of line
Hunk #2 succeeded at 41745 with fuzz 1 (offset 350 lines).
Found apxs2 sbin: /usr/bin/apxs2
===> Applying patch - apxs2 module version name ...
===> Configuring 5.4.22...

Use tail command to see what's going on:
$ tail -f /opt/phpbrew/build/php-5.4.22/build.log

./configure '--prefix=/opt/phpbrew/php/php-5.4.22' '--with-config-file-path=/opt/phpbrew/php/php-5.4.22/etc' '--with-config-file-scan-dir=/opt/phpbrew/php/php-5.4.22/var/db' '--with-pear=/opt/phpbrew/php/php-5.4.22/lib/php' '--enable-xml' '--disable-all' '--enable-phar' '--enable-session' '--enable-short-tags' '--enable-tokenizer' '--with-pcre-regex' '--with-zlib=/usr' '--with-libdir=lib/i386-linux-gnu' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--with-gettext=/usr' '--with-mcrypt=/usr' '--enable-intl' '--with-iconv=/usr' '--enable-ftp' '--enable-exif' '--enable-dba' '--with-openssl=/usr' '--enable-soap' '--enable-ipv6' '--with-imap-ssl' '--enable-debug' '--enable-cgi' '--with-apxs2=/usr/bin/apxs2' '--enable-bcmath' '--with-bz2=/usr' '--enable-calendar' '--enable-cli' '--enable-ctype' '--enable-dom' '--enable-fileinfo' '--enable-filter' '--enable-shmop' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-json' '--enable-mbregex' '--enable-mbstring' '--with-mhash' '--enable-pcntl' '--with-pcre-regex=/usr' '--with-pcre-dir=/usr' '--enable-pdo' '--enable-phar' '--enable-posix' '--with-readline=/usr' '--enable-sockets' '--enable-tokenizer' '--enable-dom' '--enable-libxml' '--enable-simplexml' '--enable-xml' '--enable-xmlreader' '--enable-xmlwriter' '--with-xsl' '--with-libxml-dir=/usr' '--with-zlib=/usr' '--enable-zip' '--with-libdir=lib/i386-linux-gnu' '--with-gd=shared' '--enable-gd-native-ttf' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--enable-wddx' '--with-mysql-sock=/var/run/mysqld/mysqld.sock' '--with-freetype-dir=/usr/include/freetype2/freetype' '--with-openssl' 2>&1 > /opt/phpbrew/build/php-5.4.22/build.log
configure: error: Please reinstall the iconv library.

@c9s

This comment has been minimized.

Copy link
Member

commented Dec 8, 2013

I found '--with-libdir=lib/i386-linux-gnu' that's correct.

prefixes using /usr are correct. see if you compile +iconv with shared?

+iconv=shared
@alanhartless

This comment has been minimized.

Copy link
Author

commented Dec 8, 2013

I'm afraid its the same error.

./configure '--prefix=/opt/phpbrew/php/php-5.4.22' '--with-config-file-path=/opt/phpbrew/php/php-5.4.22/etc' '--with-config-file-scan-dir=/opt/phpbrew/php/php-5.4.22/var/db' '--with-pear=/opt/phpbrew/php/php-5.4.22/lib/php' '--enable-xml' '--disable-all' '--enable-phar' '--enable-session' '--enable-short-tags' '--enable-tokenizer' '--with-pcre-regex' '--with-zlib=/usr' '--with-libdir=lib/i386-linux-gnu' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--with-gettext=/usr' '--with-mcrypt=/usr' '--enable-intl' '--with-iconv=/usr' '--enable-ftp' '--enable-exif' '--enable-dba' '--with-openssl=/usr' '--enable-soap' '--enable-ipv6' '--with-imap-ssl' '--enable-debug' '--enable-cgi' '--with-apxs2=/usr/bin/apxs2' '--enable-bcmath' '--with-bz2=/usr' '--enable-calendar' '--enable-cli' '--enable-ctype' '--enable-dom' '--enable-fileinfo' '--enable-filter' '--enable-shmop' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-json' '--enable-mbregex' '--enable-mbstring' '--with-mhash' '--enable-pcntl' '--with-pcre-regex=/usr' '--with-pcre-dir=/usr' '--enable-pdo' '--enable-phar' '--enable-posix' '--with-readline=/usr' '--enable-sockets' '--enable-tokenizer' '--enable-dom' '--enable-libxml' '--enable-simplexml' '--enable-xml' '--enable-xmlreader' '--enable-xmlwriter' '--with-xsl' '--with-libxml-dir=/usr' '--with-zlib=/usr' '--enable-zip' '--with-gd=shared' '--enable-gd-native-ttf' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--enable-wddx' '--with-mysql-sock=/var/run/mysqld/mysqld.sock' '--with-freetype-dir=/usr/include/freetype2/freetype' '--with-openssl' 2>&1 > /opt/phpbrew/build/php-5.4.22/build.log
configure: error: Please reinstall the iconv library.

@alanhartless

This comment has been minimized.

Copy link
Author

commented Dec 8, 2013

I tried compiling iconv from source and added +iconv=/usr/local but get same error:

./configure '--prefix=/opt/phpbrew/php/php-5.4.22' '--with-config-file-path=/opt/phpbrew/php/php-5.4.22/etc' '--with-config-file-scan-dir=/opt/phpbrew/php/php-5.4.22/var/db' '--with-pear=/opt/phpbrew/php/php-5.4.22/lib/php' '--enable-xml' '--disable-all' '--enable-phar' '--enable-session' '--enable-short-tags' '--enable-tokenizer' '--with-pcre-regex' '--with-zlib=/usr' '--with-libdir=lib/i386-linux-gnu' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--with-gettext=/usr' '--with-mcrypt=/usr' '--enable-intl' '--with-iconv=/usr/local' '--enable-ftp' '--enable-exif' '--enable-dba' '--with-openssl=/usr' '--enable-soap' '--enable-ipv6' '--with-imap-ssl' '--enable-debug' '--enable-cgi' '--with-apxs2=/usr/bin/apxs2' '--enable-bcmath' '--with-bz2=/usr' '--enable-calendar' '--enable-cli' '--enable-ctype' '--enable-dom' '--enable-fileinfo' '--enable-filter' '--enable-shmop' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-json' '--enable-mbregex' '--enable-mbstring' '--with-mhash' '--enable-pcntl' '--with-pcre-regex=/usr' '--with-pcre-dir=/usr' '--enable-pdo' '--enable-phar' '--enable-posix' '--with-readline=/usr' '--enable-sockets' '--enable-tokenizer' '--enable-dom' '--enable-libxml' '--enable-simplexml' '--enable-xml' '--enable-xmlreader' '--enable-xmlwriter' '--with-xsl' '--with-libxml-dir=/usr' '--with-zlib=/usr' '--enable-zip' '--with-gd=shared' '--enable-gd-native-ttf' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--enable-wddx' '--with-mysql-sock=/var/run/mysqld/mysqld.sock' '--with-freetype-dir=/usr/include/freetype2/freetype' '--with-openssl' 2>&1 > /opt/phpbrew/build/php-5.4.22/build.log
configure: error: Please reinstall the iconv library.

@c9s

This comment has been minimized.

Copy link
Member

commented Dec 8, 2013

seems your --with-iconv=/usr is not replaced with --with-iconv=shared

@alanhartless

This comment has been minimized.

Copy link
Author

commented Dec 8, 2013

I apologize; I must have mistyped something. Tried it again with shared and now its compiling.

@c9s

This comment has been minimized.

Copy link
Member

commented Dec 8, 2013

don't apologize, brew me a drink! hahaha :D

@alanhartless

This comment has been minimized.

Copy link
Author

commented Dec 8, 2013

I just might!

I have a new issue now. I'm trying to get gd installed but I'm getting this error after installing it:

PHP Warning: PHP Startup: Unable to load dynamic library '/opt/phpbrew/php/php-5.4.22/lib/php/extensions/debug-non-zts-20100525/gd.so' - /opt/phpbrew/php/php-5.4.22/lib/php/extensions/debug-non-zts-20100525/gd.so: undefined symbol: libiconv_open in Unknown on line 0

Seems that something is still quirky with iconv?

@c9s

This comment has been minimized.

Copy link
Member

commented Dec 8, 2013

php -m to see if iconv is loaded

If not, try

 phpbrew ext enable iconv

[Sent from iPhone]

devkardia notifications@github.com ©ó 2013/12/8 15:17 ¼g¹D¡G

I just might!

I have a new issue now. I'm trying to get gd installed but I'm getting this error after installing it:

PHP Warning: PHP Startup: Unable to load dynamic library '/opt/phpbrew/php/php-5.4.22/lib/php/extensions/debug-non-zts-20100525/gd.so' - /opt/phpbrew/php/php-5.4.22/lib/php/extensions/debug-non-zts-20100525/gd.so: undefined symbol: libiconv_open in Unknown on line 0

Seems that something is still quirky with iconv?

¡X
Reply to this email directly or view it on GitHub.

@c9s

This comment has been minimized.

Copy link
Member

commented Dec 8, 2013

Ok i know why configure can not find libiconv, because its required by gd!

I saw gd takes --with-iconv-dir instead of --with-iconv

I will add the option for it.

[Sent from iPhone]

Yo-An lin cornelius.howl@gmail.com ©ó 2013/12/8 15:34 ¼g¹D¡G

php -m to see if iconv is loaded

If not, try

 phpbrew ext enable iconv

[Sent from iPhone]

devkardia notifications@github.com ©ó 2013/12/8 15:17 ¼g¹D¡G

I just might!

I have a new issue now. I'm trying to get gd installed but I'm getting this error after installing it:

PHP Warning: PHP Startup: Unable to load dynamic library '/opt/phpbrew/php/php-5.4.22/lib/php/extensions/debug-non-zts-20100525/gd.so' - /opt/phpbrew/php/php-5.4.22/lib/php/extensions/debug-non-zts-20100525/gd.so: undefined symbol: libiconv_open in Unknown on line 0

Seems that something is still quirky with iconv?

¡X
Reply to this email directly or view it on GitHub.

@c9s

This comment has been minimized.

Copy link
Member

commented Dec 8, 2013

oh I'm wrong, gd doesn't take --with-iconv-dir , it's xmlrpc .. :(

@c9s

This comment has been minimized.

Copy link
Member

commented Dec 8, 2013

http://www.serverphorums.com/read.php?8,8538 seems like the same problem as yours.

@c9s

This comment has been minimized.

Copy link
Member

commented Dec 8, 2013

@c9s

This comment has been minimized.

Copy link
Member

commented Dec 8, 2013

found why, so if we specify with --with-iconv=/usr it found giconv instead of the correct libiconv

but if you omit the option value or assign "shared", it works.

I've commit the workaround for iconv variant at 1.11.6

@c9s

This comment has been minimized.

Copy link
Member

commented Dec 8, 2013

Just tested on Ubuntu 13.04, and it works:

php bin/phpbrew -d install 5.4.22 +iconv +gd=shared,/usr
@c9s

This comment has been minimized.

Copy link
Member

commented Dec 8, 2013

also the gd variant is fixed.

now it will use --with-gd=shared,$prefix by default.

so you don't have to append the raw configure options to command line.

phpbrew -d install 5.4.22 +iconv +gd

should work for you.

@alanhartless

This comment has been minimized.

Copy link
Author

commented Dec 8, 2013

I tried that and compilation errors out:

root@server:/home/alan# phpbrew -d install php-5.4.22 +default +gd +mysql +gettext +mcrypt +intl +iconv +ftp=shared +exif +dba +openssl +soap +ipv6 +imap +debug +cgi +apxs2=/usr/bin/apxs2 -- --enable-gd-native-ttf --with-jpeg-dir=/usr --with-png-dir=/usr --enable-wddx --with-mysql-sock=/var/run/mysqld/mysqld.sock --with-freetype-dir=/usr/include/freetype2/freetype --with-openssl
===> Downloading from http://www.php.net/get/php-5.4.22.tar.bz2/from/this/mirror
--2013-12-08 14:58:51-- http://www.php.net/get/php-5.4.22.tar.bz2/from/this/mirror
Resolving www.php.net (www.php.net)... 72.52.91.14
Connecting to www.php.net (www.php.net)|72.52.91.14|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://www.php.net/distributions/php-5.4.22.tar.bz2 [following]
--2013-12-08 14:58:51-- http://www.php.net/distributions/php-5.4.22.tar.bz2
Reusing existing connection to www.php.net:80.
HTTP request sent, awaiting response... 416 Requested Range Not Satisfiable

The file is already fully retrieved; nothing to do.

===> php-5.4.22.tar.bz2 downloaded.
Found existing php-5.4.22, Skip extracting.
Writing variant info to /opt/phpbrew/php/php-5.4.22/phpbrew.variants
Build Directory: /opt/phpbrew/build/php-5.4.22
PHP Version lower than 5.4.0 can only build one SAPI at the same time.
+apxs2 is in conflict with cgi
Disabling cgi
Enabled variants: gd, mysql, gettext, mcrypt, intl, iconv, ftp, exif, dba, openssl, soap, ipv6, imap, debug, cgi, apxs2, xml, bcmath, bz2, calendar, cli, ctype, dom, fileinfo, filter, ipc, json, mbregex, mbstring, mhash, pcntl, pcre, pdo, phar, posix, readline, sockets, tokenizer, curl, zip
Disabled variants: cgi
===> Applying patch file for freetype include path bug...
patching file configure
Hunk #1 succeeded at 39423 (offset 210 lines).
patch unexpectedly ends in middle of line
Hunk #2 succeeded at 41815 with fuzz 1 (offset 420 lines).
Found apxs2 sbin: /usr/bin/apxs2
===> Applying patch - apxs2 module version name ...
===> Configuring 5.4.22...

Use tail command to see what's going on:
$ tail -f /opt/phpbrew/build/php-5.4.22/build.log

./configure '--prefix=/opt/phpbrew/php/php-5.4.22' '--with-config-file-path=/opt/phpbrew/php/php-5.4.22/etc' '--with-config-file-scan-dir=/opt/phpbrew/php/php-5.4.22/var/db' '--with-pear=/opt/phpbrew/php/php-5.4.22/lib/php' '--disable-all' '--enable-phar' '--enable-session' '--enable-short-tags' '--enable-tokenizer' '--with-pcre-regex' '--with-zlib=/usr' '--with-libdir=lib/i386-linux-gnu' '--enable-gd-native-ttf' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-freetype-dir=/usr' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--with-gettext=/usr' '--with-mcrypt=/usr' '--enable-intl' '--with-iconv' '--enable-ftp' '--enable-exif' '--enable-dba' '--with-openssl=/usr' '--enable-soap' '--enable-ipv6' '--with-imap-ssl' '--enable-debug' '--enable-cgi' '--with-apxs2=/usr/bin/apxs2' '--enable-dom' '--enable-libxml' '--enable-simplexml' '--enable-xml' '--enable-xmlreader' '--enable-xmlwriter' '--with-xsl' '--with-libxml-dir=/usr' '--enable-bcmath' '--with-bz2=/usr' '--enable-calendar' '--enable-cli' '--enable-ctype' '--enable-dom' '--enable-fileinfo' '--enable-filter' '--enable-shmop' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-json' '--enable-mbregex' '--enable-mbstring' '--with-mhash' '--enable-pcntl' '--with-pcre-regex=/usr' '--with-pcre-dir=/usr' '--enable-pdo' '--enable-phar' '--enable-posix' '--with-readline=/usr' '--enable-sockets' '--enable-tokenizer' '--with-zlib=/usr' '--enable-zip' '--disable-cgi' '--enable-gd-native-ttf' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--enable-wddx' '--with-mysql-sock=/var/run/mysqld/mysqld.sock' '--with-freetype-dir=/usr/include/freetype2/freetype' '--with-openssl' 2>&1 > /opt/phpbrew/build/php-5.4.22/build.log
===> Building...
make 2>&1 >> /opt/phpbrew/build/php-5.4.22/build.log
ext/iconv/.libs/iconv.o: In function _php_iconv_appendl': /opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:401: undefined reference tolibiconv'
/opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:438: undefined reference to libiconv' ext/iconv/.libs/iconv.o: In functionphp_iconv_string':
/opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:494: undefined reference to libiconv_open' /opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:506: undefined reference tolibiconv'
/opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:524: undefined reference to libiconv' /opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:535: undefined reference tolibiconv_close'
ext/iconv/.libs/iconv.o: In function _php_iconv_strlen': /opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:660: undefined reference tolibiconv_open'
/opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:683: undefined reference to libiconv' /opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:717: undefined reference tolibiconv_close'
ext/iconv/.libs/iconv.o: In function _php_iconv_substr': /opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:780: undefined reference tolibiconv_open'
/opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:804: undefined reference to libiconv' /opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:812: undefined reference tolibiconv_open'
/opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:859: undefined reference to libiconv_close' /opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:863: undefined reference tolibiconv_close'
ext/iconv/.libs/iconv.o: In function _php_iconv_strpos': /opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:908: undefined reference tolibiconv_open'
/opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:936: undefined reference to libiconv' /opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:1050: undefined reference tolibiconv_close'
ext/iconv/.libs/iconv.o: In function _php_iconv_mime_encode': /opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:1100: undefined reference tolibiconv_open'
/opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:1114: undefined reference to libiconv_open' /opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:1185: undefined reference tolibiconv'
/opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:1217: undefined reference to libiconv' /opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:1233: undefined reference tolibiconv'
/opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:1285: undefined reference to libiconv' /opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:1316: undefined reference tolibiconv'
ext/iconv/.libs/iconv.o:/opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:1359: more undefined references to libiconv' follow ext/iconv/.libs/iconv.o: In function_php_iconv_mime_encode':
/opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:1372: undefined reference to libiconv_close' /opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:1375: undefined reference tolibiconv_close'
ext/iconv/.libs/iconv.o: In function _php_iconv_mime_decode': /opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:1410: undefined reference tolibiconv_open'
/opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:1521: undefined reference to libiconv_close' /opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:1524: undefined reference tolibiconv_open'
/opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:1906: undefined reference to libiconv_close' /opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:1909: undefined reference tolibiconv_close'
ext/iconv/.libs/iconv.o: In function php_iconv_stream_filter_dtor': /opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:2486: undefined reference tolibiconv_close'
ext/iconv/.libs/iconv.o: In function php_iconv_stream_filter_ctor': /opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:2512: undefined reference tolibiconv_open'
ext/iconv/.libs/iconv.o: In function php_iconv_stream_filter_append_bucket': /opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:2558: undefined reference tolibiconv'
/opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:2636: undefined reference to libiconv' /opt/phpbrew/build/php-5.4.22/ext/iconv/iconv.c:2637: undefined reference tolibiconv'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1

@c9s

This comment has been minimized.

Copy link
Member

commented Dec 8, 2013

that's weird, where is your iconv header files?

@c9s

This comment has been minimized.

Copy link
Member

commented Dec 9, 2013

Try php-config to see the options of your current php

@c9s

This comment has been minimized.

Copy link
Member

commented Dec 9, 2013

If the options are with the same value, then it's a php build system bug on Ubuntu 12.04

@c9s

This comment has been minimized.

Copy link
Member

commented Dec 9, 2013

@c9s

This comment has been minimized.

Copy link
Member

commented Dec 9, 2013

By the way, did you installed another library under the /usr/local ? I guess the default prefix on Ubuntu Linux should be "/usr", not "/usr/local".

@c9s

This comment has been minimized.

Copy link
Member

commented Dec 9, 2013

You may also grep the ICONV in the source directory:

grep ICONV main/php_config.h 

See what comes up with?

@alanhartless

This comment has been minimized.

Copy link
Author

commented Dec 14, 2013

Hi Pedro,

I apologize for the delay; had to put this on hold to deal with some more emergent things.

I did try compiling a new version of icon since I couldn't get the native one to work for this. I've since uninstalled it, deleted the php-5.4.22 source directory so its a clean compile, and reran phpbrew's install command. But still no go; same errors.

When I run grep command, I get:

/* #undef COMPILE_DL_ICONV /
/
#undef HAVE_BSD_ICONV /
/
#undef HAVE_GICONV_H /
#define HAVE_GLIBC_ICONV 1
/
#undef HAVE_IBM_ICONV /
#define HAVE_ICONV 1
/
#undef HAVE_LIBICONV /
/
#undef ICONV_ALIASED_LIBICONV */
#define ICONV_SUPPORTS_ERRNO 1
#define PHP_ICONV_H_PATH </usr/include/iconv.h>
#define PHP_ICONV_IMPL "glibc"

@alanhartless

This comment has been minimized.

Copy link
Author

commented Dec 14, 2013

the PHP_ICONV_H_PATH was stripped out because it had tags, the value was /usr/include/iconv.h

@c9s

This comment has been minimized.

Copy link
Member

commented Dec 14, 2013

Hi @devkardia,

No problem. :)

did you check the https://bugs.php.net/bug.php?id=52611 bug, it seems like it's the same problem you encountered. I saw the last comment were using /usr/local/lib as its prefix.

@alanhartless

This comment has been minimized.

Copy link
Author

commented Dec 14, 2013

Yea; none of the solutions seemed to work. I ended up compiling libiconv, gd, and pcre myself then using the following to compile:

./configure
'--prefix=/opt/phpbrew/php/php-5.4.22'
'--with-config-file-path=/opt/phpbrew/php/php-5.4.22/etc'
'--with-config-file-scan-dir=/opt/phpbrew/php/php-5.4.22/var/db'
'--with-pear=/opt/phpbrew/php/php-5.4.22/lib/php'
'--disable-all'
'--enable-phar'
'--enable-session'
'--enable-short-tags'
'--enable-tokenizer'
'--with-zlib=/usr'
'--with-iconv=/usr/local'
'--with-iconv-dir=/usr/local'
'--with-jpeg-dir=/usr'
'--with-png-dir=/usr'
'--with-freetype-dir=/usr'
'--with-mysql=mysqlnd'
'--with-mysqli=mysqlnd'
'--with-pdo-mysql=mysqlnd'
'--with-gettext=/usr'
'--with-mcrypt=/usr'
'--enable-intl'
'--enable-ftp'
'--enable-exif'
'--enable-dba'
'--with-openssl=/usr'
'--enable-soap'
'--enable-ipv6'
'--with-imap-ssl'
'--enable-debug'
'--enable-cgi'
'--with-apxs2=/usr/bin/apxs2'
'--enable-dom'
'--enable-libxml'
'--enable-simplexml'
'--enable-xml'
'--enable-xmlreader'
'--enable-xmlwriter'
'--with-xsl'
'--with-libxml-dir=/usr'
'--enable-bcmath'
'--with-bz2=/usr'
'--enable-calendar'
'--enable-cli'
'--enable-ctype'
'--enable-dom'
'--enable-fileinfo'
'--enable-filter'
'--enable-shmop'
'--enable-sysvsem'
'--enable-sysvshm'
'--enable-sysvmsg'
'--enable-json'
'--enable-mbregex'
'--enable-mbstring'
'--with-mhash'
'--enable-pcntl'
'--with-pcre-regex=/usr/local'
'--with-pcre-dir=/usr/local'
'--enable-pdo'
'--enable-phar'
'--enable-posix'
'--with-readline=/usr'
'--enable-sockets'
'--enable-tokenizer'
'--with-zlib=/usr'
'--enable-zip'
'--with-gd=/usr/local'
'--enable-gd-native-ttf'
'--with-jpeg-dir=/usr'
'--with-png-dir=/usr'
'--enable-wddx'
'--with-mysql-sock=/var/run/mysqld/mysqld.sock'
'--with-freetype-dir=/usr/include/freetype2/freetype'
'--with-openssl'

I don't know why it wouldn't compile otherwise with phpbrew or why I had such an issue with iconv.

Thanks!
Alan

@kiprasbal

This comment has been minimized.

Copy link

commented Dec 23, 2013

I do like this sudo ln -s /usr/lib/libpcre.so /usr/libpcre.so , and it worked for me

@tomasdelvechio

This comment has been minimized.

Copy link

commented Feb 6, 2014

@sensejus

I do like this sudo ln -s /usr/lib/libpcre.so /usr/libpcre.so , and it worked for me

This is worked for me and fixed this problem.

@sangheonhan

This comment has been minimized.

Copy link

commented Feb 7, 2014

I use Ubuntu 12.04 AMD64.

I solved the following option.

--with-libdir=lib/x86_64-linux-gnu

@GulDmitry

This comment has been minimized.

Copy link

commented Feb 20, 2014

Ubuntu 12.10.
The error configure: error: Could not find libpcre.(a|so) in /usr solved by the command sudo ln -s /usr/lib/x86_64-linux-gnu/libpcre.so /usr/libpcre.so.

@marcioAlmada

This comment has been minimized.

Copy link
Member

commented Jun 17, 2014

This seems platform specific. Thanks for sharing the workarounds ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.