在编译安装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