php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21153 readline won't be built as an external module
Submitted: 2002-12-22 19:29 UTC Modified: 2003-02-20 07:59 UTC
Votes:3
Avg. Score:3.3 ± 0.5
Reproduced:3 of 3 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: oden dot eriksson at linux-mandrake dot com Assigned:
Status: No Feedback Package: Readline related
PHP Version: 4.3.0RC4 OS: Mandrake 9.0
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: oden dot eriksson at linux-mandrake dot com
New email:
PHP Version: OS:

 

 [2002-12-22 19:29 UTC] oden dot eriksson at linux-mandrake dot com
Hi.

(sorry, this one was accidently also filed as #21152, I forgot to change the summary...)

readline won't build as a external module. Here's my configure line that don't work:

./configure \
    --prefix=/usr \
    --exec-prefix=/usr \
    --bindir=/usr/bin \
    --sbindir=/usr/sbin \
    --datadir=/usr/share \
    --sysconfdir=/etc \
    --libdir=/usr/lib \
    --includedir=/usr/include \
    --infodir=/usr/share/info \
    --mandir=/usr/share/man \
    --with-apxs2=/usr/sbin/apxs \
    --enable-force-cgi-redirect \
    --enable-discard-path \
    --enable-debug \
    --with-layout=GNU \
    --with-config-file-path=/etc \
    --with-config-file-scan-dir=/etc/httpd/conf.d \
    --with-pear=/usr/lib/php \
    --enable-safe-mode \
    --with-exec-dir=/usr/bin \
    --enable-magic-quotes \
    --disable-rpath \
    --with-openssl=shared,/usr --with-zlib=shared,/usr --with-zlib-dir=/usr \
    --enable-bcmath=shared \
    --with-bz2=shared,/usr \
    --enable-calendar=shared \
    --without-cpdflib \
    --with-jpeg-dir=/usr \
    --with-tiff-dir=/usr \
    --without-crack \
    --with-ctype=shared \
    --with-curl=shared,/usr \
    --without-cyrus \
    --without-db \
    --enable-dba=shared,/usr \
    --with-gdbm=shared,/usr \
    --without-ndbm \
    --without-db2 \
    --without-db3 \
    --with-db4=shared,/usr \
    --without-dbm \
    --with-cdb=shared,/usr \
    --with-flatfile=shared \
    --enable-dbase=shared \
    --enable-dbx=shared,/usr \
    --enable-dio=shared,/usr \
    --with-dom=shared,/usr --with-zlib-dir=/usr --with-dom-xslt=shared,/usr --with-dom-exslt=shared,/usr \
    --enable-exif=shared \
    --without-fbsql \
    --without-fdftk \
    --enable-filepro=shared \
    --without-fribidi \
    --enable-ftp=shared \
    --with-gd=shared --with-jpeg-dir=/usr --with-png-dir=/usr --with-zlib-dir=/usr --with-xpm-dir=/usr/X11R6/lib/ \
    --with-ttf=/usr \
    --with-freetype-dir=/usr \
    --with-t1lib=/usr \
    --enable-gd-native-ttf \
    --with-gettext=shared,/usr \
    --with-gmp=shared,/usr \
    --without-hwapi \
    --without-hyperwave \
    --without-iconv \
    --with-imap=shared,/usr \
    --without-kerberos \
    --with-imap-ssl=shared,/usr \
    --without-informix \
    --without-ingres \
    --without-interbase \
    --without-ircg \
    --with-ircg-config=/dev/null \
    --without-java \
    --with-ldap=shared,/usr \
    --enable-mbstring=shared \
    --enable-mbregex=shared \
    --without-mcal \
    --with-mcrypt=shared,/usr \
    --without-mcve \
    --with-mhash=shared,/usr \
    --enable-mime-magic=shared \
    --with-ming=shared,/usr \
    --with-mnogosearch=shared,/usr \
    --without-msession \
    --without-msql \
    --without-mssql \
    --with-mysql=shared,/usr --with-mysql-sock=/var/lib/mysql/mysql.sock --with-zlib-dir=/usr \
    --with-ncurses=shared,/usr \
    --without-oci8 \
    --without-adabas \
    --without-sapdb \
    --without-solid \
    --without-ibm-db2 \
    --without-empress \
    --without-empress-bcs \
    --without-birdstep \
    --without-custom-odbc \
    --without-iodbc \
    --without-esoob \
    --with-unixODBC=shared,/usr \
    --without-openlink \
    --without-dbmaker \
    --without-oracle \
    --enable-overload=shared \
    --without-ovrimos \
    --disable-pcntl \
    --without-pcre-regex \
    --with-pcre-regex=shared,/usr \
    --without-pdflib --with-jpeg-dir=/usr --with-png-dir=/usr --with-zlib-dir=/usr --with-tiff-dir=/usr \
    --without-pfpro \
    --with-pgsql=shared,/usr \
    --enable-posix=shared \
    --with-pspell=shared,/usr \
    --without-qtdom \
    --without-libedit \
    --with-readline=shared,/usr \
    --with-recode=shared,/usr \
    --enable-session=shared \
    --without-mm \
    --enable-shmop=shared \
    --with-snmp=shared,/usr \
    --enable-ucd-snmp-hack \
    --enable-sockets=shared \
    --with-regex=php \
    --without-swf \
    --without-sybase \
    --with-sybase-ct=shared,/usr \
    --enable-sysvmsg=shared \
    --enable-sysvsem=shared \
    --enable-sysvshm=shared \
    --enable-tokenizer=shared \
    --enable-wddx=shared \
    --disable-xml \
    --with-expat-dir=shared,/usr \
    --with-xmlrpc=shared,/usr \
    --with-expat-dir=shared,/usr \
    --without-iconv-dir \
    --enable-xslt=shared,/usr \
    --with-xslt-sablot=shared,/usr \
    --with-expat-dir=shared,/usr \
    --without-iconv-dir \
    --with-sablot-js=shared,/usr \
    --without-yaz \
    --enable-yp=shared \
    --with-zip=shared,/usr \
    --enable-shared \
    --with-pic \
    --enable-inline-optimization \
    --enable-memory-limit


Here's the configure line that does work:


READLINE_SHARED_LIBADD="-lhistory -lreadline -lncurses" ./configure --with-readline=shared,/usr


Somewhere down the line the configure stuff gets messed up..., I have no idea where and why... It doesn't matter if I add the READLINE_SHARED_LIBADD environment to the first configure line. And of course I have all the needed dev stuff installed.

Chears.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-07 12:57 UTC] jmdault at mandrakesoft dot com
It does not work with:
cd ext/readline;phpize;aclocal
./configure --with-readline
[--SNIP--]
checking for libedit readline replacement... yes, shared
checking for readline support... yes, shared
checking for tgetent in -lncurses... yes
checking for readline in -lreadline... no
configure: error: readline library not found

The problem is it checks for tgetent in -lncurses, but it doesn't add the lib 
in the $LIBS variable.

I have the GNU readline library, version 4.3

I managed to get it work, but then, it also insists on checking *both* readline and libedit.

So I installed libedit, and the same problem with the -lncurses appeared.

Seems to me someone should check the config.m4....
 [2003-01-12 16:00 UTC] fdragon at fdragon dot org
This looks to be related to readline includes in /usr/include and the actualy libraries being installed in /lib so they are available for applications such as bash during boot up when /usr may not be available.
 [2003-01-13 12:24 UTC] oden dot eriksson at linux-mandrake dot com
No, it's because ncurses stuff isn't present in readline for Mandrake. I found the error and sent a patch a while back to the cooker list, it went ignored (that's not unusual).

Well, here's the fix anyway:

http://www.mandrake.com/en/archives/cooker/2002-12/msg01367.php

Chears.
 [2003-02-10 21:14 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip


And if it still fails, send me the config.log file.

 [2003-02-20 07:59 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2003-03-14 09:46 UTC] Andrew dot Duka at oktet dot ru
The same problem appears on the redhat boxes (7.3, 8.0).
But solution is quite simple: to get readline support in PHP you need ncurses-devel package installed on your redhat box.

This works on redhat-7.3 and 8.0 with PHP 4.3.1 and PHP4-200303141430 snapshot.
 [2005-11-11 22:29 UTC] timharper at softhome dot net
I had the same problem as described by jmdault

Using:
  php-5.0.4 packed for fedora core 4
  php-devel-5.0.4 (for phpize and other necessary tools)
  php-5.0.5 source (to build modules)

-I extracted the source, and wanted to build the php module

-I typed the following:
cd php-5.0.5/ext/readline
./configure

-on configure, this error came
checking for readline in -lreadline... no
configure: error: readline library not found

(this is the same error as reported by jmdault)

i had installed readline and readline-devel.  I knew it was there.  When running "ld -lreadline", I would get this error:
ld: warning: cannot find entry symbol _start; not setting start address
/usr/lib/libreadline.so: undefined reference to `tgetnum'
/usr/lib/libreadline.so: undefined reference to `tgoto'
/usr/lib/libreadline.so: undefined reference to `tgetflag'
/usr/lib/libreadline.so: undefined reference to `BC'
/usr/lib/libreadline.so: undefined reference to `tputs'
/usr/lib/libreadline.so: undefined reference to `PC'
/usr/lib/libreadline.so: undefined reference to `tgetent'
/usr/lib/libreadline.so: undefined reference to `UP'
/usr/lib/libreadline.so: undefined reference to `tgetstr'

It was then I realized the it wasn't properly linking the lncurses library when checking lreadline (not sure why)

to fix it, I edited configure, and changed this line:
LIBS="-lreadline $LIBS"

to this:
LIBS="-lreadline -lncurses $LIBS"

I saved configure, and reran it, and configure worked.

This is quite a hack, I'm sure... there has to be a better way to do it... but, maybe a patch would be in order?
 [2010-02-16 22:18 UTC] xykatra at gmail dot com
Try installing slang first
 [2010-03-06 14:40 UTC] dominique-php dot net at leuenberger dot net
(This is actually still valid with php 5.3.0, with which I ran into this issue)
 [2010-03-06 14:42 UTC] dominique-php dot net at leuenberger dot net
I ran into the same issue (and out of time pressure used the same hacky solution of replacing it directly in configure).

It would actually be better if php's configure routine would just  get the needed LIBS for libedit from it's provided pkgconfig file. The issue actually arises from libraries being built with -Wl,-as-needed (which can leave the lib with unresolved symbols -> perfectly valid). But in this case the end application needs to link in libncurses to resolve the symbols (no missing symbols in a binary).
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 19:01:30 2024 UTC