免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 10530 | 回复: 8
打印 上一主题 下一主题

[Web] 64位系统 编译安装php+openssl 安装出错 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-11-26 10:44 |只看该作者 |倒序浏览
64位系统 编译安装php+openssl 安装出错
安装步骤:
# tar /root/software/openssl-0.9.8b.tar.gz -C /usr/local/src/
# cd /usr/local/src/openssl-0.9.8b/
# ./config --prefix=/usr/local/ssl/
# make&&make test&&make install
# tar /root/software
# tar /root/software/php-4.4.9.tar.gz -C /usr/local/src/
# cd /usr/local/src/php-4.4.9/
# ./configure --with-apxs=/usr/local/apache/bin/apxs --with-gd --with-zlib-dir --with-jpeg-dir --with-png-dir=/usr/ --enable-url-includes --enable-sockets --with-mysql=/usr/local/mysql --with-iconv --with-mcrypt --with-openssl=/usr/local/ssl --with-mbstring --enable-mbstring=all
# make
然后报错如下:
/usr/local/ssl/lib/libssl.a(s23_meth.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/local/ssl/lib/libssl.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [libphp4.la] Error 1

重新编译openssl
# ./config -fPIC --prefix=/usr/local/ssl/
# make&&make test&&make install
# cd /usr/local/src/php-4.4.9/
# ./configure --with-apxs=/usr/local/apache/bin/apxs --with-gd --with-zlib-dir --with-jpeg-dir --with-png-dir=/usr/ --enable-url-includes --enable-sockets --with-mysql=/usr/local/mysql --with-iconv --with-mcrypt --with-openssl=/usr/local/ssl --with-mbstring --enable-mbstring=all
# make 依旧出错

如果使用系统自带的openssl 可以编译通过
步骤:
rpm -qa |grep openssl
openssl-0.9.7a-43.10
xmlsec1-openssl-1.2.6-3
openssl-0.9.7a-43.10
openssl-devel-0.9.7a-43.10
xmlsec1-openssl-devel-1.2.6-3
xmlsec1-openssl-1.2.6-3
openssl096b-0.9.6b-22.42
openssl096b-0.9.6b-22.42


# cd /usr/local/src/php-4.4.9/
# ./configure --with-apxs=/usr/local/apache/bin/apxs --with-gd --with-zlib-dir --with-jpeg-dir --with-png-dir=/usr/ --enable-url-includes --enable-sockets --with-mysql=/usr/local/mysql --with-iconv --with-mcrypt --with-openssl --with-mbstring --enable-mbstring=all

问:
编译的openssl 共享库文件无法被php所使用,请各位大侠指点一二!THKS!

论坛徽章:
0
2 [报告]
发表于 2009-11-26 11:54 |只看该作者
重新编译openssl
# ./config -fPIC --prefix=/usr/local/ssl/
# make&&make test&&make install

这个是不是应该看看,有关x86_64的编译帮助。

论坛徽章:
0
3 [报告]
发表于 2009-11-26 12:01 |只看该作者
原帖由 blueswxs 于 2009-11-26 11:54 发表
重新编译openssl
# ./config -fPIC --prefix=/usr/local/ssl/
# make&&make test&&make install

这个是不是应该看看,有关x86_64的编译帮助。

同意

论坛徽章:
0
4 [报告]
发表于 2009-11-26 22:28 |只看该作者
原帖由 blueswxs 于 2009-11-26 11:54 发表
重新编译openssl
# ./config -fPIC --prefix=/usr/local/ssl/
# make&&make test&&make install

这个是不是应该看看,有关x86_64的编译帮助。


大侠,能否再详细点?

论坛徽章:
0
5 [报告]
发表于 2009-11-29 15:00 |只看该作者
原帖由 johnnwang 于 2009-11-26 22:28 发表


大侠,能否再详细点?



重新编译openssl
# ./config -fPIC --prefix=/usr/local/ssl/



# ./config   --help
把帮助贴上来吧,大伙帮你看看有没有关于x86_64的选项。
加上再编译一下SSL,估计就OK。

论坛徽章:
0
6 [报告]
发表于 2009-11-30 11:02 |只看该作者

回复 #5 blueswxs 的帖子

Operating system: x86_64-whatever-linux2
Configuring for linux-x86_64
Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-krb5] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--test-sanity] os/compiler[:flags]

编译参数,请提供帮助,感激!

论坛徽章:
0
7 [报告]
发表于 2009-11-30 12:10 |只看该作者
原帖由 johnnwang 于 2009-11-30 11:02 发表
Operating system: x86_64-whatever-linux2
Configuring for linux-x86_64
Usage: Configure [no- ...] [enable- ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]sha ...




/usr/src/openssl-0.9.8b
[root@blues openssl-0.9.8b]# ls I*
INSTALL        INSTALL.MacOS  INSTALL.OS2  INSTALL.W32  INSTALL.WCE
INSTALL.DJGPP  INSTALL.NW     INSTALL.VMS  INSTALL.W64

如果是win64读下这个文档INSTALL.W64。


cat INSTALL

  386           Use the 80386 instruction set only (the default x86 code is  more efficient, but requires at least a 486).
                   Note: Use  compiler flags for any other CPU specific configuration ,   e.g. "-m32" to build x86 code on an x64 system.

楼主尝试在编译的时候加上:
-m32

论坛徽章:
0
8 [报告]
发表于 2009-11-30 14:57 |只看该作者

回复 #7 blueswxs 的帖子

谢谢blueswxs 的热心帮助,现问题已经解决,操作步骤为
重新编译openssl
# ./config -fPIC --prefix=/usr/local/ssl/ enable-shared
# make&&make test&&make install
# cd /usr/local/src/php-4.4.9/
# ./configure --with-apxs=/usr/local/apache/bin/apxs --with-gd --with-zlib-dir --with-jpeg-dir --with-png-dir=/usr/ --enable-url-includes --enable-sockets --with-mysql=/usr/local/mysql --with-iconv --with-mcrypt --with-openssl=/usr/local/ssl --with-mbstring --enable-mbstring=all
# make
# make install

备注:
在安装openssl 时候加了enable-shared 参数,我一直认为enable-shared 与 -fPIC  的功能是一样的,都是使编译后的库文件为共享库。但是这次必须使用enable-shared .至于是否两个参数都加上,目前没有测试,我是两个一起用的。

论坛徽章:
0
9 [报告]
发表于 2009-11-30 15:29 |只看该作者
原帖由 johnnwang 于 2009-11-30 14:57 发表
谢谢blueswxs 的热心帮助,现问题已经解决,操作步骤为
重新编译openssl
# ./config -fPIC --prefix=/usr/local/ssl/ enable-shared
# make&&make test&&make install
# cd /usr/local/src/php-4.4.9/
#  ...



您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP