依赖包汇总
yum -y install pcre pcre-devel openssl openssl-devel libicu-devel gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel ncurses ncurses-devel curl curl-devel krb5-devel libidn libidn-devel openldap openldap-devel openldap-servers openldap-client nss_ldap jemalloc-devel cmake boost-devel bison automake libevent libevent-devel gd gd-devel libtool* libmcrypt libmcrypt-devel mcrypt mhash libxslt libxslt-devel readline readline-devel gmp gmp-devel libcurl libcurl-devel openjpeg-devel
编译
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-mysqlnd-compression-support --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --enable-intl --with-mcrypt --with-libmbfl --enable-ftp --with-gd --enable-gd-jis-conv --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --with-gettext --disable-fileinfo --enable-opcache --with-pear --enable-maintainer-zts --with-ldap=shared --without-gdbm --with-mcrypt --enable-gd-native-ttf
报错
configure: error: Cannot find ldap.h
configure: error: Cannot find ldap libraries in /usr/lib
首先查看:# rpm -qa openldap*
openldap-devel-2.4.40-8.el7.x86_64
openldap-clients-2.4.40-8.el7.x86_64
openldap-2.4.40-8.el7.x86_64
openldap-servers-2.4.40-8.el7.x86_64
openldap四个包缺少的则安装上去
yum install openldap openldap-devel openldap-servers openldap-client
然后执行:
cp -frp /usr/lib64/libldap* /usr/lib/
(2)
checking for cURL 7.10.5 or greater…
configure: error: cURL version 7.10.5 or later is required to compile php with cURL support
首先查看 rpm -qa libcurl*
libcurl-7.29.0-25.el7.centos.x86_64
发现少了libcurl-dev
安装yum install libcurl-devel
PS:如果还是不行,请参考https://yq.aliyun.com/ask/24123
https://curl.haxx.se/download/ 下载并重新编译curl
当然,如果本身bin/curl-config --version 显示版本号没问题,就另当别论。
附上来源:
if test -n “$PKNAME”; then
{
a
s
e
c
h
o
"
as_echo "
asecho"as_me:KaTeX parse error: Expected '}', got 'EOF' at end of input: {as_lineno-LINENO}: checking for cURL 7.10.5 or greater" >&5
$as_echo_n “checking for cURL 7.10.5 or greater… " >&6; }
if $PKG_CONFIG --atleast-version 7.10.5
P
K
N
A
M
E
;
t
h
e
n
c
u
r
l
v
e
r
s
i
o
n
f
u
l
l
=
‘
PKNAME; then curl_version_full=`
PKNAME;thencurlversionfull=‘PKG_CONFIG --modversion $PKNAME`
{
a
s
e
c
h
o
"
as_echo "
asecho"as_me:KaTeX parse error: Expected '}', got 'EOF' at end of input: {as_lineno-LINENO}: result: $curl_version_full” >&5
a
s
e
c
h
o
"
as_echo "
asecho"curl_version_full" >&6; }
else
as_fn_error
?
"
c
U
R
L
v
e
r
s
i
o
n
7.10.5
o
r
l
a
t
e
r
i
s
r
e
q
u
i
r
e
d
t
o
c
o
m
p
i
l
e
p
h
p
w
i
t
h
c
U
R
L
s
u
p
p
o
r
t
"
"
? "cURL version 7.10.5 or later is required to compile php with cURL support" "
?"cURLversion7.10.5orlaterisrequiredtocompilephpwithcURLsupport""LINENO" 5
fi