Sivo 悉见

编译php出现error: ld returned 1 exit status make: ***

匿名 · 更新于 2015/2/27

linux mint 编译php-5.2.17的时候出现如下的错误: 

php-5.2.17/ext/openssl/xp_ssl.c:357: undefined reference to SSLv2_server_method&#39;&nbsp;<wbr /></span><br style="color: rgb(70, 70, 70); font-size: 14px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.1875px;" /> <span style="word-wrap: normal; word-break: normal; line-height: 25.1875px; color: rgb(70, 70, 70); font-size: 14px; font-family: Helvetica, Tahoma, Arial, sans-serif;">php-5.2.17/ext/openssl/xp_ssl.c:337: undefined reference to SSLv2_client_method' 
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&nbsp;
patch -p1 < debian_patches_disable_SSLv2_for_openssl_1_0_0.patch 
然后再重新编译php 

make clean 
make && make install