|  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
Status: Closed Package: Compile Failure
PHP Version: 5.2, 5.3, 6 OS: Linux (Fedora)
Private report: No CVE-ID:
 [2009-11-17 21:49 UTC] tcallawa at redhat dot com
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:

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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-12-13 17:06 UTC]
Automatic comment from SVN on behalf of felipe
Log: - Fixed bug #50209 (Compiling with libedit cannot find readline.h)
  (patch by tcallawa at redhat dot com)
 [2009-12-13 17:07 UTC]
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
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 

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

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 
 [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-2015 The PHP Group
All rights reserved.
Last updated: Tue Oct 06 18:01:32 2015 UTC