linux php 7 configure: error: Please reinstall readline - I cannot find readline.h, but it is installed

Viewed 7966

I am compiling php7 from source and have pre compiled a number of dependencies in /home/mybin for example I have openssl in

   /home/mybin/bin/openssl
   /home/mybin/include/openssl/*.h

I have also readline as

/home/mybin/include/readline/readline.h

using the php compile options

./configure \
CC=/home/mybin/bin/gcc \
--prefix=/home/_cgi/php7 \
--bindir=/home/mybin/bin \
--libdir=/home/mybin/lib \
--with-libdir=/home/mybin/lib64 \
--includedir=/home/mybin/include \
--include-openssl \

i have tried the following options for readline

--with-readline=/home/mybin/include/readline
OR 
--with-readline=/home/mybin/
OR
--with-readline

all variations end with configure: error: Please reinstall readline - I cannot find readline.h

All other dependencies built from source and in /home/mybin are found no problem. Can you suggest what flag I sould set so readline.h can be found?

thx Art

3 Answers

On Debian-9 first, I installed libreadline-dev package using

apt-get install libreadline-dev

and then when searching for the path of readline.h using command

dpkg -S readline.h

It gave me below output:

nodejs: /usr/share/doc/nodejs/api/readline.html libreadline-dev:amd64: /usr/include/readline/readline.h

So the file is located in /usr directory

Finally I configured php using --with-readline=/usr and everything was fine.

for readline you need to install

sudo apt install -y libedit-dev libreadline-dev

Related