Output
checking for libedit readline replacement... yes
configure: error: Please reinstall libedit - I cannot find readline.h
Expected Result
compiled php version
Command
$ phpbrew --debug install 7.0 +everything
Build Log
https://gist.github.com/oNdsen/f6231c0aef5a7492427a0689219fd518
Platform
OS:
Debian GNU/Linux 8 (jessie)
Running PHP:
doesnt matter. tried with 5.6, 7.0, 7.1
Installing PHP:
tryed each one of the following versions:
7.1.7, 7.0.21, 7.0.20, 5.6.31
Comment
this problem exists on 3 different debian servers. each server has allready compiled php versions installed (on january, via same phpbrew installation).
what ive done:
$ phpbrew update
$ phpbrew --debug install 7.0 +everything
so, readline is installed. i just cannot compile a new php version after i updated phpbrew (doesnt matter with or without extensions).
root@web01:~# apt-get install libedit2 libreadline6 libreadline6-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libedit2 is already the newest version.
libreadline6 is already the newest version.
libreadline6-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
root@web01:~# find / -name "readline.h"
/usr/include/readline/readline.h
Установка необходимой версии PHP из исходных файлов на сервер под управлением CentOS
Порой необходимо поставить версию PHP “морально устаревшую”. К сожалению попадаются такие проекты, которые не хотят переписывать сайты и готовы существовать на старом ПО. Статья именно про такой случай.
Шаг 1. Подготовка среды
Установим инструменты для сборки
yum install wget
yum groupinstall "Development Tools"
Шаг 2. Загружаем исходники
(В примере рассматривается вариант с версией 5.3.28, но процесс сборки ничем не отличается и для других версий, за редким исключением)
Скачиваем необходимую версию PHP с сайта разработчика
wget http://fr2.php.net/distributions/php-5.3.28.tar.gz
tar -xvf php-5.3.28.tar.gz
cd php-5.3.28
Шаг 3. Производим конфигурацию
Конфигурация производится с включением/отключением необходимых модулей, поэтому следует заранее подготовиться.
Указываем опцию --with-config-file-path=/etc
, чтобы файл конфигурации был в папке /etc
, а не в /usr/local/lib
, как идет по умолчанию в Unix системах.
Начинаем процесс конфигурации
(В случае получения ошибок в процессе конфигурации, информацию по их исправлению можно найти дальше в статье )
./configure
--prefix=/usr/local
--with-layout=PHP
--with-pear
--with-apxs2
--enable-calendar
--enable-bcmath
--with-gmp
--enable-exif
--with-mcrypt
--with-mhash
--with-zlib
--with-bz2
--enable-zip
--enable-ftp
--enable-mbstring
--with-iconv
--enable-intl
--with-icu-dir=/usr
--with-gettext
--with-pspell
--enable-sockets
--with-openssl
--with-curl
--with-curlwrappers
--with-gd
--enable-gd-native-ttf
--with-libdir=lib64
--with-jpeg-dir=/usr
--with-png-dir=/usr
--with-zlib-dir=/usr
--with-xpm-dir=/usr
--with-vpx-dir=/usr
--with-freetype-dir=/usr
--with-t1lib=/usr
--with-libxml-dir=/usr
--with-mysql=mysqlnd
--with-mysqli=mysqlnd
--with-pdo-mysql=mysqlnd
--with-config-file-path=/etc
--enable-exif
--enable-shmop
--enable-wddx
--enable-soap
--with-xmlrpc
--with-xsl
--with-tidy=/usr
--with-readline
--enable-pcntl
--enable-sysvshm
--enable-sysvmsg
--enable-shmop
При успешной конфигурации вывод будет приблизительно следующим:
Generating files
updating cache ./config.cache
creating ./config.status
creating php5.spec
creating main/build-defs.h
creating scripts/phpize
creating scripts/man1/phpize.1
creating scripts/php-config
creating scripts/man1/php-config.1
creating sapi/cli/php.1
creating main/php_config.h
creating main/internal_functions.c
creating main/internal_functions_cli.c
+--------------------------------------------------------------------+
| License: |
| This software is subject to the PHP License, available in this |
| distribution in the file LICENSE. By continuing this installation |
| process, you are bound by the terms of this license agreement. |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point. |
+--------------------------------------------------------------------+
Thank you for using PHP.
Notice: Following unknown configure options were used:
--with-vpx-dir=/usr
Check './configure --help' for available options
Производим сборку
make && make install
Вывод при успешной сборке будет приблизительно следующий:
Installing PHP SAPI module: apache2handler
/usr/lib64/httpd/build/instdso.sh SH_LIBTOOL='/usr/lib64/apr-1/build/libtool' libphp5.la /usr/lib64/httpd/modules
/usr/lib64/apr-1/build/libtool --mode=install cp libphp5.la /usr/lib64/httpd/modules/
libtool: install: cp .libs/libphp5.so /usr/lib64/httpd/modules/libphp5.so
libtool: install: cp .libs/libphp5.lai /usr/lib64/httpd/modules/libphp5.la
libtool: install: warning: remember to run `libtool --finish /tmp/php-5.3.28/libs'
chmod 755 /usr/lib64/httpd/modules/libphp5.so
[activating module `php5' in /etc/httpd/conf/httpd.conf]
Installing PHP CLI binary: /usr/local/bin/
Installing PHP CLI man page: /usr/local/man/man1/
Installing build environment: /usr/local/lib/php/build/
Installing header files: /usr/local/include/php/
Installing helper programs: /usr/local/bin/
program: phpize
program: php-config
Installing man pages: /usr/local/man/man1/
page: phpize.1
page: php-config.1
Installing PEAR environment: /usr/local/lib/php/
[PEAR] Archive_Tar - installed: 1.3.11
[PEAR] Console_Getopt - installed: 1.3.1
warning: pear/PEAR requires package "pear/Structures_Graph" (recommended version 1.0.4)
warning: pear/PEAR requires package "pear/XML_Util" (recommended version 1.2.1)
[PEAR] PEAR - installed: 1.9.4
Wrote PEAR system config file at: /usr/local/etc/pear.conf
You may want to add: /usr/local/lib/php to your php.ini include_path
[PEAR] Structures_Graph- installed: 1.0.4
[PEAR] XML_Util - installed: 1.2.1
/tmp/php-5.3.28/build/shtool install -c ext/phar/phar.phar /usr/local/bin
ln -s -f /usr/local/bin/phar.phar /usr/local/bin/phar
Installing PDO headers: /usr/local/include/php/ext/pdo/
Проверяем установку
[[email protected] php-5.3.28]
PHP 5.3.28 (cli) (built: May 28 2015 23:29:01)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
Распространенные ошибки при компилировании
Ошибка #1
Sorry, I cannot run apxs. Possible reasons follow:
1. Perl is not installed
2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs
3. Apache was not built using --enable-so (the apxs usage page is displayed)
The output of apxs follows:
./configure: line 6372: apxs: command not found
configure: error: Aborting
Решение #1
yum install httpd-devel
Ошибка #2
checking libxml2 install dir... /usr
checking for xml2-config path...
configure: error: xml2-config not found. Please check your libxml2 installation.
Решение #2
yum install libxml2 libxml2-devel
Ошибка #3
checking for pkg-config... /usr/bin/pkg-config
configure: error: Cannot find OpenSSL's <evp.h>
Решение #3
yum install openssl openssl-devel
Ошибка #4
checking for BZip2 support... yes
checking for BZip2 in default path... not found
configure: error: Please reinstall the BZip2 distribution
Решение #4
yum install bzip2 bzip2-devel
Ошибка #5
checking for cURL in default path... not found
configure: error: Please reinstall the libcurl distribution -
easy.h should be in <curl-dir>/include/curl/
Решение #5
yum install curl curl-devel
Ошибка #6
configure: error: jpeglib.h not found.
Решение #6
yum install libjpeg libjpeg-devel
Ошибка #7
configure: error: png.h not found.
Решение #7
yum install libpng libpng-devel
Ошибка #8
configure: error: libXpm.(a|so) not found.
Решение #8
yum install libXpm-devel
Ошибка #9
configure: error: freetype.h not found.
Решение #9
yum install freetype-devel
Ошибка #10
configure: error: Your t1lib distribution is not installed correctly. Please reinstall it.
Решение #10
yum install t1lib-devel
Ошибка #11
checking for GNU MP support... yes
configure: error: Unable to locate gmp.h
Решение #11
yum install gmp-devel
Ошибка #12
checking for location of ICU headers and libraries... not found
configure: error: Unable to detect ICU prefix or /usr/bin/icu-config failed. Please verify ICU install prefix and make sure icu-config works.
Решение #12
yum install libicu-devel
Ошибка #13
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
Решение #13
yum install libmcrypt libmcrypt-devel
Ошибка #14
configure: error: Cannot find pspell
Решение #14
yum install aspell-devel
Ошибка #15
configure: error: Please reinstall readline - I cannot find readline.h
Решение #15
yum install readline-devel
Ошибка #16
checking for TIDY support... yes
configure: error: Cannot find libtidy
Решение #16
yum install libtidy libtidy-devel
Ошибка #17
configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution
Решение #17
yum install libxslt-devel
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
Add a Patch
Pull Requests
Add a Pull Request
History
AllCommentsChangesGit/SVN commitsRelated reports
[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).
configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution
yum install libxslt-devel
configure: error: Could not find net-snmp-config binary. Please check your net-snmp installation.
yum install net-snmp-devel
configure: error: Please reinstall readline — I cannot find readline.h
yum install readline-devel
configure: error: Cannot find pspell
yum install aspell-devel
checking for unixODBC support… configure: error: ODBC header file ‘/usr/include/sqlext.h’ not found!
yum install unixODBC-devel
configure: error: Unable to detect ICU prefix or /usr/bin/icu-config failed. Please verify ICU install prefix and make sure icu-config works.
yum install libicu-devel
configure: error: utf8mime2text() has new signature, but U8TCANONICAL is missing. This should not happen. Check config.log for additional information.
yum install libc-client-devel
configure: error: freetype.h not found.
yum install freetype-devel
configure: error: xpm.h not found.
yum install libXpm-devel
configure: error: png.h not found.
yum install libpng-devel
configure: error: vpx_codec.h not found.
yum install libvpx-devel
configure: error: Cannot find enchant
yum install enchant-devel
configure: error: Please reinstall the libcurl distribution — easy.h should be in <curl-dir>/include/curl/
yum install libcurl-devel
this article is post on https://coderwall.com/p/ggmpfa
configure:error:xslt-config not found. please reinstall the libxslt>= 1.1.0 distribution
yum -y install libxslt-devel
configure:error:could not find net-snmp-config binary. please check your net-snmp installation.
yum -y install net-snmp-devel
configure:error:please reinstall readline-i cannot find readline.h
yum -y install readline-devel
configure:error:cannot find pspell
yum -y install aspell-devel
checking for unixodbc support … configure:error:odbc header file «/usr/include/sqlext.h» not found!
yum -y install unixodbc-devel
configure:error:unable to detect icu prefix or/usr/bin/icu-config failed. please verify icu install prefix and make sure icu-config works.
yum -y install libicu-devel
configure:error:utf8mime2text () has new signature, but u8tcanonical is missing. this should not happen. check config.log for additional information.
yum -y install libc-client-devel
configure:error:freetype.h not found.
yum -y install freetype-devel
configure:error:xpm.h not found.
yum -y install libxpm-devel
configure:error:png.h not found.
yum -y install libpng-devel
configure:error:vpx_codec.h not found.
yum -y install libvpx-devel
configure:error:cannot find enchant
yum -y install enchant-devel
configure:error:please reinstall the libcurl distribution-easy.h should be in/include/curl /
yum -y install libcurl-devel
laogao added 20140907:
configure:error:mcrypt.h not found. please reinstall libmcrypt.
wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/libmcrypt-2.5.7.tar.gz
tar zxf libmcrypt-2.5.7.tar.gz
cd libmcrypt-2.5.7
./configure
make&&make install
added 20141003:
cannot find imap
ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
configure:error:utf8_mime2text () has new signature, but u8t_canonical is missing.
yum -y install libc-client-devel
cannot find ldap.h
yum -y install openldap
yum -y install openldap-devel
configure:error:cannot find ldap libraries in/usr/lib
<strong>
cp -frp/usr/lib64/libldap */usr/lib /
</strong>
configure:error:cannot find libpq-fe.h. please specify correct postgresql installation path
yum -y install postgresql-devel
configure:error:please reinstall the lib curl distribution
yum -y install curl-devel
configure:error:could not find net-snmp-config binary. please check your net-snmp installation.
yum -y install net-snmp-devel
configure:error:xslt-config not found. please reinstall the libxslt>= 1.1.0 distribution
yum -y install libxslt-devel
checking for bzip2 support … yes checking for bzip2 in default path … not found configure:error:please reinstall the bzip2 distribution
fix:
yum -y install bzip2-devel
checking for curl support … yes checking if we should use curl for url streams … no checking for curl in default path … not found configure:error:please reinstall the libcurl distribution – easy.h should be in/include/curl /
fix:
yum -y install curl-devel
checking for curl_multi_strerror in -lcurl … yes checking for qdbm support … no checking for gdbm support … no checking for ndbm support … no configure:error:dba:could not find necessary header file (s).
fix:
yum -y install db4-devel
checking for fabsf … yes checking for floorf … yes configure:error:jpeglib.h not found.
fix:
yum -y install libjpeg-devel
checking for fabsf … yes checking for floorf … yes checking for jpeg_read_header in -ljpeg … yes configure:error:png.h not found.
fix:
yum -y install libpng-devel
checking for png_write_image in -lpng … yes if configure fails try —with-xpm-dir =
configure:error:freetype.h not found.
fix:
reconfigure your php with the following option. --with-xpm-dir =/usr
checking for png_write_image in -lpng… yes configure:error:libxpm. (a | so) not found.
fix:
yum -y install libxpm-devel
checking for bind_textdomain_codeset in -lc … yes checking for gnu mp support … yes configure:error:unable to locate gmp.h
fix:
yum -y install gmp-devel
checking for utf8_mime2text signature … new checking for u8t_decompose … configure:error:utf8_mime2text () has new signature, but u8t_canonical is missing. this should not happen. check config.log for additional information.
fix:
yum -y install libc-client-devel
checking for ldap support … yes, shared checking for ldap cyrus sasl support … yes configure:error:cannot find ldap.h
fix:
yum -y install openldap-devel
checking for mysql_set_character_set in -lmysqlclient … yes checking for mysql_stmt_next_result in -lmysqlclient … no checking for oracle database oci8 support … no checking for unixodbc support … configure:error:odbc header file «/usr/include/sqlext.h» not found!
fix:
yum -y install unixodbc-devel
checking for postgresql support for pdo… yes, shared checking for pg_config… not found configure:error:cannot find libpq-fe.h. please specify correct postgresql installation path
fix:
yum -y install postgresql-devel
checking for sqlite 3 support for pdo… yes, shared checking for pdo includes… (cached) /usr/local/src/php-5.3.7/ext checking for sqlite3 files in default path… not found configure:error:please reinstall the sqlite3 distribution
fix:
yum -y install sqlite-devel
checking for utsname.domainname … yes checking for pspell support … yes configure:error:cannot find pspell
fix:
yum -y install aspell-devel
checking whether to enable ucd snmp hack … yes checking for default_store.h … no
checking for kstat_read in -lkstat… no checking for snmp_parse_oid in -lsnmp… no checking for init_snmp in -lsnmp… no configure:error:snmp sanity check failed. please check config.log for more information.
fix:
yum -y install net-snmp-devel
checking whether to enable xmlwriter support … yes, shared checking for xml2-config path … (cached)/usr/bin/xml2-config checking whether libxml build works … (cached) yes checking for xsl support … yes, shared configure:error:xslt-config not found. please reinstall the libxslt>= 1.1.0 distribution
fix:
yum -y install libxslt-devel
configure:error:xml2-config not found. please check your libxml2 installation.
fix:
yum -y install libxml2-devel
checking for pcre headers location… configure:error:could not find pcre.h in/usr
fix:
yum -y install pcre-devel
configure:error:cannot find mysql header files under yes. note that the mysql client library is not bundled anymore!
fix:
yum -y install mysql-devel
checking for unixodbc support … configure:error:odbc header file «/usr/include/sqlext.h» not found!
fix:
yum -y install unixodbc-devel
checking for pg_config… not found configure:error:cannot find libpq-fe.h. please specify correct postgresql installation path
fix:
yum -y install postgresql-devel
configure:error:cannot find pspell
fix:
yum -y install pspell-devel
configure:error:could not find net-snmp-config binary. please check your net-snmp installation.
fix:
yum -y install net-snmp-devel
configure:error:xslt-config not found. please reinstall the libxslt>= 1.1.0 distribution
fix:
yum -y install libxslt-devel
Я компилирую php7 из исходного кода и предварительно скомпилировал ряд зависимостей в /home/mybin
например у меня есть openssl в
/home/mybin/bin/openssl
/home/mybin/include/openssl/*.h
Я также читал как
/home/mybin/include/readline/readline.h
используя опции компиляции php
./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
я пробовал следующие варианты для readline
--with-readline=/home/mybin/include/readline
OR
--with-readline=/home/mybin/
OR
--with-readline
все варианты заканчиваются configure: error: Please reinstall readline - I cannot find readline.h
Все остальные зависимости построены из источника и в /home/mybin
не найдено никаких проблем. Можете ли вы предложить, какой флаг я должен установить так readline.h
может быть найден?
спасибо искусство
2
Решение
Другие решения
для readline вам нужно установить
sudo apt install -y libedit-dev libreadline-dev
0
Exception: apxs binary is not executable: apt-get install apache2-dev apache2-prefork-dev find / -name "apxs*" phpbrew install 5.6 +default +mysql +pdo +apxs2=/usr/bin/apxs2 +icu +intl
configure: error: xml2-config not found. Please check your libxml2 installation.
apt-get install libxml2-dev
checking for BZip2 in default path… not found
apt-get install libbz2-dev
configure: error: Please reinstall the libcurl distribution
apt-get install libcurl4-gnutls-dev
checking for location of ICU headers and libraries… not found
apt-get install -y libicu-dev
configure: error: C++ preprocessor «/lib/cpp» fails sanity check
apt-get install g++
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
apt-get install libmcrypt-dev
configure: error: Please reinstall readline — I cannot find readline.h
apt-get install libreadline-dev
configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution
apt install libxslt-dev
sh: 1: make: not found
apt-get install make
checking whether to enable JIS-mapped Japanese font support in GD… no
apt-get install libjpeg62-dev
checking whether to enable JIS-mapped Japanese font support in GD… no
apt-get install libjpeg62-dev libpng-dev libfreetype6-dev
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies