我正在尝试编译和安装 phpredis 存储库的 php7 分支,但出现以下错误:
/bin/sh /root/phpredis/libtool --mode=compile cc -I. -I/root/phpredis - DPHP_ATOM_INC -I/root/phpredis/include -I/root/phpredis/main -I/root/phpredis -I/usr/lib64/php7.0/include/php -I/usr/lib64/php7.0/include/php/main -I/usr/lib64/php7.0/include/php/TSRM -I/usr/lib64/php7.0/include/php/Zend -I/usr/lib64/php7.0/include/php/ext -I/usr/lib64/php7.0/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/phpredis/redis.c -o redis.lo libtool: Version mismatch error. This is libtool 2.4.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.4.6 libtool: and run autoconf again. Makefile:193: recipe for target 'redis.lo' failed make: *** [redis.lo] Error 63
By now this is are the steps i followed:
git clone https://github.com/phpredis/phpredis.git cd phpredis/ git checkout php7 phpize && ./configure --with-php-config=/usr/bin/php-config && make
Tools versions:
# autoconf --version autoconf (GNU Autoconf) 2.69 # aclocal --version aclocal (GNU automake) 1.15 # libtoolize --version libtoolize (GNU libtool) 2.4.6
Running autoreconf --force --install
i get the following:
# autoreconf --force --install libtoolize: putting auxiliary files in '.'. libtoolize: copying file './ltmain.sh' libtoolize: You should add the contents of the following files to 'aclocal.m4': libtoolize: '/usr/share/aclocal/libtool.m4' libtoolize: '/usr/share/aclocal/ltoptions.m4' libtoolize: '/usr/share/aclocal/ltsugar.m4' libtoolize: '/usr/share/aclocal/ltversion.m4' libtoolize: '/usr/share/aclocal/lt~obsolete.m4' libtoolize: Consider adding 'AC_CONFIG_MACRO_DIRS([m4])' to configure.in, libtoolize: and rerunning libtoolize and aclocal. libtoolize: Consider adding '-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
So then i do:
cat /usr/share/aclocal/libtool.m4 /usr/share/aclocal/ltoptions.m4 /usr/share/aclocal/ltsugar.m4 /usr/share/aclocal/ltversion.m4 /usr/share/aclocal/lt~obsolete.m4 >> aclocal.m4
Then i add AC_CONFIG_MACRO_DIRS([m4]) to the top level of configure.in
现在运行 autoreconf --force --install
没有输出,但我在尝试编译 phpredis 时仍然遇到同样的错误。
最佳答案
我终于解决了这个问题。如果您遇到上述问题,这些是让 phpredis 运行所需的步骤:
git clone https://github.com/phpredis/phpredis.git
cd phpredis/
git checkout php7
rm -f aclocal.m4
phpize
aclocal && libtoolize --force && autoreconf
./configure --with-php-config=/usr/bin/php-config && make
# in my case previous make command installed the redis.so into ~/phpredis/modules/
make install #optional
关于c# - libtool:您应该使用 libtool 2.4.6 中的宏重新创建 aclocal.m4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36473591/