制作 PHP 5.3.28 时出错

制作 PHP 5.3.28 时出错

我尝试使用以下命令构建 PHP 版本 5.3.28:

[root@server php-5.3.28]# ./configure --with-apxs2=/usr/bin/apxs --with-libdir=lib64 --cache-file=./config.cache --prefix=/usr/local/php-5.3.28 --with-config-file-path=/usr/local/php-5.3.28/etc --disable-debug --with-pic --disable-rpath  --with-bz2 --with-curl --with-freetype-dir=/usr/local/php-5.3.28 --with-png-dir=/usr/local/php-5.3.28 --enable-gd-native-ttf --without-gdbm --with-gettext --with-gmp --with-iconv --with-jpeg-dir=/usr/local/php-5.3.28 --with-openssl --with-pspell --with-pcre-regex --with-zlib --enable-exif --enable-ftp --enable-sockets --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-wddx --with-kerberos --with-unixODBC=/usr --enable-shmop --enable-calendar --with-libxml-dir=/usr/local/php-5.3.28 --enable-pcntl --with-imap --with-imap-ssl --enable-mbstring --enable-mbregex --with-gd --enable-bcmath --with-xmlrpc --with-ldap --with-ldap-sasl --with-mysql=/usr --with-mysqli --with-snmp --enable-soap --with-xsl --enable-xmlreader --enable-xmlwriter --enable-pdo --with-pdo-mysql --with-pear=/usr/local/php-5.3.28/pear --with-mcrypt --without-pdo-sqlite --with-config-file-scan-dir=/usr/local/php-5.3.28/php.d --enable-cgi

...

[root@server php-5.3.28]# make

...

_ptr_stack.lo Zend/zend_stack.lo Zend/zend_variables.lo Zend/zend.lo Zend/zend_API.lo Zend/zend_extensions.lo Zend/zend_hash.lo Zend/zend_list.lo Zend/zend_indent.lo Zend/zend_builtin_functions.lo Zend/zend_sprintf.lo Zend/zend_ini.lo Zend/zend_qsort.lo Zend/zend_multibyte.lo Zend/zend_ts_hash.lo Zend/zend_stream.lo Zend/zend_iterators.lo Zend/zend_interfaces.lo Zend/zend_exceptions.lo Zend/zend_strtod.lo Zend/zend_gc.lo Zend/zend_closures.lo Zend/zend_float.lo Zend/zend_objects.lo Zend/zend_object_handlers.lo Zend/zend_objects_API.lo Zend/zend_default_classes.lo Zend/zend_execute.lo sapi/apache2handler/mod_php5.lo sapi/apache2handler/sapi_apache2.lo sapi/apache2handler/apache_config.lo sapi/apache2handler/php_functions.lo main/internal_functions.lo -lcrypt -lc-client -lexslt -lcrypt -laspell -lpspell -lmysqlclient -lmcrypt -lltdl -lldap -llber -lcrypt -lpam -lgmp -lfreetype -lpng -lz -ljpeg -lcurl -lbz2 -lz -lrt -lm -ldl -lnsl -lxml2 -lz -lm -ldl -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -lcurl -lxml2 -lz -lm -ldl -lssl -lcrypto -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -lmysqlclient -lz -lm -lrt -lssl -lcrypto -ldl -lodbc -lmysqlclient -lz -lm -lrt -lssl -lcrypto -ldl -lxml2 -lz -lm -ldl -lnetsnmp -lrt -lssl -lssl -lcrypto -lm -lxml2 -lz -lm -ldl -lcrypt -lxml2 -lz -lm -ldl -lxml2 -lz -lm -ldl -lxml2 -lz -lm -ldl -lxml2 -lz -lm -ldl -lxml2 -lz -lm -ldl -lxslt -lxml2 -lz -ldl -lm -lrt -lcrypt  -o libphp5.la
/bin/ld: cannot find -lltdl
collect2: error: ld returned 1 exit status
make: *** [libphp5.la] Error 1
[root@server php-5.3.28]# 

我也尝试过

[root@server php-5.3.28]# make clean

但没有成功。

我的操作系统版本:

[root@server php-5.3.28]# cat /etc/redhat-release 
Fedora release 18 (Spherical Cow)

64 位架构。我有以下库:

[root@server php-5.3.28]# rpm -qa |grep -i ltdl
libtool-ltdl-2.4.2-7.fc18.x86_64
libtool-ltdl-2.4.2-7.fc18.i686

我该如何修复 make 错误的问题?

我尝试过这个解决方案,但没有成功:

命令 ldconfig -p | grep ltdl 的输出如下:

[root@server php-5.3.28]# ldconfig -p | grep ltdl
        libltdl.so.7 (libc6,x86-64) => /lib64/libltdl.so.7
        libltdl.so.7 (libc6) => /lib/libltdl.so.7
[root@server php-5.3.28]#

它不在 /usr/local/lib 下。我是否仍要添加 /lib/libltdl.so.7?

我已经检查过文件:

[root@server php-5.3.28]# ls -alh /lib64/libltdl.so.7
lrwxrwxrwx 1 root root 16 Feb 14  2013 /lib64/libltdl.so.7 -> libltdl.so.7.3.0
[root@server php-5.3.28]#

我已经编辑了文件 /etc/ld.so.conf:

[root@server php-5.3.28]# more /etc/ld.so.conf
include ld.so.conf.d/*.conf
/lib/libltdl.so.7
[root@server php-5.3.28]#

并运行:

[root@server php-5.3.28]# ldconfig

它对我没有帮助。 make 期间出现相同的错误消息:

... Zend/zend_ini_scanner.lo Zend/zend_alloc.lo Zend/zend_compile.lo Zend/zend_constants.lo Zend/zend_dynamic_array.lo Zend/zend_execute_API.lo Zend/zend_highlight.lo Zend/zend_llist.lo Zend/zend_opcode.lo Zend/zend_operators.lo Zend/zend_ptr_stack.lo Zend/zend_stack.lo Zend/zend_variables.lo Zend/zend.lo Zend/zend_API.lo Zend/zend_extensions.lo Zend/zend_hash.lo Zend/zend_list.lo Zend/zend_indent.lo Zend/zend_builtin_functions.lo Zend/zend_sprintf.lo Zend/zend_ini.lo Zend/zend_qsort.lo Zend/zend_multibyte.lo Zend/zend_ts_hash.lo Zend/zend_stream.lo Zend/zend_iterators.lo Zend/zend_interfaces.lo Zend/zend_exceptions.lo Zend/zend_strtod.lo Zend/zend_gc.lo Zend/zend_closures.lo Zend/zend_float.lo Zend/zend_objects.lo Zend/zend_object_handlers.lo Zend/zend_objects_API.lo Zend/zend_default_classes.lo Zend/zend_execute.lo sapi/apache2handler/mod_php5.lo sapi/apache2handler/sapi_apache2.lo sapi/apache2handler/apache_config.lo sapi/apache2handler/php_functions.lo main/internal_functions.lo -lcrypt -lc-client -lexslt -lcrypt -laspell -lpspell -lmysqlclient -lmcrypt -lltdl -lldap -llber -lcrypt -lpam -lgmp -lfreetype -lpng -lz -ljpeg -lcurl -lbz2 -lz -lrt -lm -ldl -lnsl -lxml2 -lz -lm -ldl -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -lcurl -lxml2 -lz -lm -ldl -lssl -lcrypto -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -lmysqlclient -lz -lm -lrt -lssl -lcrypto -ldl -lodbc -lmysqlclient -lz -lm -lrt -lssl -lcrypto -ldl -lxml2 -lz -lm -ldl -lnetsnmp -lrt -lssl -lssl -lcrypto -lm -lxml2 -lz -lm -ldl -lcrypt -lxml2 -lz -lm -ldl -lxml2 -lz -lm -ldl -lxml2 -lz -lm -ldl -lxml2 -lz -lm -ldl -lxml2 -lz -lm -ldl -lxslt -lxml2 -lz -ldl -lm -lrt -lcrypt  -o libphp5.la
/bin/ld: cannot find -lltdl
collect2: error: ld returned 1 exit status
make: *** [libphp5.la] Error 1

答案1

因为ld您需要.so.a文件(.so.[0-9]*上面没有数字)。

在基于 rpm 的发行版中,这些通常保存在名称中带有“devel”的包中。

我谷歌搜索“ltdl devel rpm”,发现了这个:

http://rpmfind.net/linux/rpm2html/search.php?query=libtool-ltdl-devel

那肯定就是你需要的。

yum install libtool-ltdl-devel很可能会这么做。

答案2

检查输出

ldconfig -p | grep ltdl

可能是找不到库。如果是这样,请尝试查看 lib 安装在哪里,并将其添加到

/etc/ld.so.conf

例如,如果它在 /usr/local/lib 中,则将 /usr/local/lib 添加到 ld.so.conf

然后运行

ldconfig

再次尝试运行

相关内容