不灭的焱

革命尚未成功,同志仍须努力下载JDK17

作者:Albert.Wen  添加时间:2022-02-27 23:31:01  修改时间:2024-04-24 19:50:52  分类:Linux软件安装/参数优化  编辑

在编译安装PHP7.4,执行如下configure命令:

./configure \
--prefix=/alidata/server/php/php-7.4 \
--with-config-file-path=/alidata/server/php/php-7.4/etc \
--with-fpm-user=www \
--with-fpm-group=www \
--with-openssl \
--with-zlib \
--with-bz2 \
--enable-gd \
--with-jpeg-dir \
--with-png-dir \
--with-iconv-dir \
--with-kerberos \
--with-libdir=lib64 \
--with-libxml-dir \
--with-mhash \
--with-freetype-dir \
--with-mcrypt \
--with-iconv=/usr/local/libiconv \
--with-curl \
--with-xmlrpc \
--with-xsl \
--with-pcre-regex \
--with-pdo-mysql \
--with-pdo-sqlite \
--with-mysqli \
--enable-calendar \
--enable-pdo \
--enable-zip \
--enable-mbstring \
--enable-mbregex \
--enable-bcmath \
--enable-libxml \
--enable-inline-optimization \
--enable-soap \
--enable-sockets \
--enable-ftp \
--enable-gd-native-ttf \
--enable-shmop \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-xml \
--enable-pcntl \
--enable-fpm \
--enable-opcache \
--without-pear \
--with-gettext

报错:

configure: error: Please reinstall the iconv library.

解决方案:

不用管上述的configure错误,直接执行下一步的make命令即可:

make ZEND_EXTRA_LIBS='-liconv'
make install

 

 

参考:CentOS 6.5 编译 PHP-7 报错:undefined reference to `libiconv_open 无法编译 PHP libiconv