centos7 下编译php-5.2.17的时候出现如下的错误:
collect2: ld returned 1 exit status make: *** [sapi/cgi/php-cgi] 错误 1
这个需要一个补丁禁用openssl的SSLv2_client_method,方法如下:
cd php-5.2.17/ wget http://www.centos.bz/wp-content/uploads/2012/06/debian_patches_disable_SSLv2_for_openssl_1_0_0.patch patch -p1 < debian_patches_disable_SSLv2_for_openssl_1_0_0.patch make clean
然后再重新编译php
./configure --prefix=/usr/local/php5217 --with-mysql=/usr/local/mysql --with-mysqli=/usr/bin/mysql_config --with-mysql-sock=/var/lib/mysql/mysql.sock --with-iconv-dir=/usr/bin --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr/lib64 --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-gd --enable-gd-native-ttf --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap make && make install
转载请注明:MitNick » centos7 nginx编译PHP 5.2.17 collect2: error: ld returned 1 exit status