|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62612 readline extension compilation fails with sapi/cli/cli.h: No such file
Submitted: 2012-07-19 15:56 UTC Modified: 2012-07-22 21:31 UTC
From: pgodel at gmail dot com Assigned: johannes
Status: Closed Package: Compile Failure
PHP Version: 5.4.4 OS: Centos 6 & Ubuntu 12.04
Private report: No CVE-ID:
 [2012-07-19 15:56 UTC] pgodel at gmail dot com
Trying to compile the readline extension standalone.
cd etx/readline

It fails with:

php-5.4.4/ext/readline/readline_cli.c:64:26: fatal error: sapi/cli/cli.h: No 
such file or directory

If I make a symlink to the sapi directory, the compilation works:
ln -s ../../sap



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-07-19 15:57 UTC] pgodel at gmail dot com
The symlink is:
cd ext/readline/
ln -s ../../sapi

Sorry about that.
 [2012-07-20 04:28 UTC]
-Status: Open +Status: Feedback
 [2012-07-20 04:28 UTC]
can you paste your config steps out? 
 [2012-07-20 13:48 UTC] pgodel at gmail dot com
This is the main PHP configure line:

./configure --with-apxs2=/usr/bin/apxs2 \
            --prefix=/usr/local/php54 \
            --with-config-file-scan-dir=/etc/php54/conf.d \
            --enable-bcmath --enable-ctype --enable-exif --enable-mbstring --
enable-ftp --enable-intl --enable-sockets --enable-sysvmsg --enable-pcntl --
with-bz2 --with-curl --with-gettext --with-gd --enable-gd-native-ttf --enable-
exif --with-freetype-dir=/usr --with-jpeg-dir=/usr --with-t1lib=/usr --with-
mcrypt --with-openssl --with-kerberos --with-iconv --with-xsl --with-xmlrpc --
with-zlib --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \

And the when compiling the readline extension I just run:

./configure # from ext/readline
 [2012-07-20 13:48 UTC] pgodel at gmail dot com
-Status: Feedback +Status: Open
 [2012-07-20 15:57 UTC]
what does your /PATH_TO_PHP_BIN/php-config output?
 [2012-07-20 22:18 UTC] pgodel at gmail dot com
Usage: /usr/local/php54/bin/php-config [OPTION]
  --prefix            [/usr/local/php54]
  --includes          [-I/usr/local/php54/include/php -
I/usr/local/php54/include/php/main -I/usr/local/php54/include/php/TSRM -
I/usr/local/php54/include/php/Zend -I/usr/local/php54/include/php/ext -
  --ldflags           [ -L/usr/lib/x86_64-linux-gnu]
  --libs              [-lcrypt   -lexslt -lresolv -lcrypt -lrt -lmcrypt -lltdl -
lstdc++ -lt1 -lfreetype -lpng -lz -ljpeg -lcurl -lbz2 -lz -lrt -lm -ldl -lnsl  -
lxml2 -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -lcurl -lxml2 -
lssl -lcrypto -ldl -lm -licui18n -licuuc -licudata -ldl -lm -licuio -lxml2 -
lcrypt -lxml2 -lxml2 -lxml2 -lxml2 -lxslt -lxml2 -lcrypt ]
  --extension-dir     [/usr/local/php54/lib/php/extensions/no-debug-non-zts-
  --include-dir       [/usr/local/php54/include/php]
  --man-dir           [/usr/local/php54/php/man]
  --php-binary        [/usr/local/php54/bin/php]
  --php-sapis         [ apache2handler cli cgi]
  --configure-options [--with-apxs2=/usr/bin/apxs2 --prefix=/usr/local/php54 --
with-config-file-scan-dir=/etc/php54/conf.d --enable-bcmath --enable-ctype --
enable-mbstring --enable-ftp --enable-intl --enable-sockets --enable-sysvmsg --
enable-pcntl --with-bz2 --with-curl --with-gettext --with-gd --enable-gd-native-
ttf --enable-exif --with-freetype-dir=/usr --with-jpeg-dir=/usr --with-
t1lib=/usr --with-mcrypt --with-openssl --with-kerberos --with-iconv --with-xsl 
--with-xmlrpc --with-zlib --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-
  --version           [5.4.5]
  --vernum            [50405]
 [2012-07-21 04:37 UTC]
okey , is that -L flags right? 
I mean, did you mv the php install directory after you installed it?
 [2012-07-22 19:35 UTC]
We don't fully support building bundled extensions stand-alone. I'll look into this case though.
 [2012-07-22 19:35 UTC]
-Status: Open +Status: Assigned -Assigned To: +Assigned To: johannes
 [2012-07-22 21:29 UTC]
Automatic comment on behalf of johannes
Log: Fix Bug #62612 readline extension compilation fails
 [2012-07-22 21:31 UTC]
-Status: Assigned +Status: Closed
 [2012-07-22 21:31 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

 For Windows:
Thank you for the report, and for helping us make PHP better.

cli.h is fine to be installed, I feared we might have to refactore it beforehand but that's not the case. A stand-alone compiled readline ext should have it available now.
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sat Apr 19 06:02:27 2014 UTC