php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50209 Compiling with libedit cannot find readline.h
Submitted: 2009-11-17 21:49 UTC Modified: 2009-12-13 17:07 UTC
From: tcallawa at redhat dot com Assigned: felipe (profile)
Status: Closed Package: Compile Failure
PHP Version: 5.2, 5.3, 6 OS: Linux (Fedora)
Private report: No CVE-ID: None
 [2009-11-17 21:49 UTC] tcallawa at redhat dot com
Description:
------------
The PHP code assumes that even with libedit in use (instead of readline), that the header can be found in readline/readline.h.

libedit installs its "readline.h" into editline/ (to avoid the obvious conflict with readline).

Accordingly, configure claims that libedit is not properly installed, when it is. I've written a straightforward patch to fix this:

http://spot.fedorapeople.org/php-5.3.0-libedit.patch

It is also possible to use pkgconfig to ask libedit for its include flags (and cflags), which would return "-I/usr/include/editline", but as that was slightly more intrusive, I did not go down that road.

In addition, on a system where readline-devel and libedit-devel are both installed, the existing code checking for /usr/include/readline-devel will cause a false positive when checking for libedit, and will end up doing a compile with readline's headers and libedit's library.

Reproduce code:
---------------
./configure --without-readline --with-libedit


Expected result:
----------------
checking for libedit readline replacement... yes
checking for readline in -ledit... yes


Actual result:
--------------
checking for libedit readline replacement... yes
configure: error: Please reinstall libedit - I cannot find readline.h


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-12-13 17:06 UTC] svn@php.net
Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&revision=292081
Log: - Fixed bug #50209 (Compiling with libedit cannot find readline.h)
  (patch by tcallawa at redhat dot com)
 [2009-12-13 17:07 UTC] felipe@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Thanks for the patch!
 [2011-07-04 12:12 UTC] breck7 at gmail dot com
While compiling the new PHP 5.4 release I tried using: --with-readline, --with-
libedit, and --with-libedit --without-readline and always got " I cannot find 
readline.h"

In case anyone has trouble reinstalling readline, run this: sudo apt-get install 
libreadline-devel

I found that tricky (was trying install readline, install readline--devel, 
install libedit, install libedit--devel, etc.).

I figured I'd post this since this is the first Google result for "I cannot find 
readline.h"
 [2011-09-02 14:51 UTC] post at tentimes dot org
It's libreadline-dev you need to add, not readline-dev. But, thanks a lot for the 
tip! That is just what I was missing (for 5.38).
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 08:01:29 2024 UTC