doucheng2053 2015-12-19 18:32
浏览 272

如何在支持openssl的情况下在CentOS6.7上编译PHP7.0.1?

I am trying to compile PHP7.0.1 on CentOS 6.7 with openssl support but I am getting an error. I have narrowed the issue to openssl because I can compile php fine when I remove "--with-openssl" and "--with-openssl-dir" from the configure command below.

I thought it might be a problem with the version of openssl so I upgraded it to openssl-1.0.2e. I know this worked because when I issue "/usr/bin/openssl version" I get "OpenSSL 1.0.2e 3 Dec 2015". This also confirms the path to this version of openssl.

Here is my full configure command:

./configure --prefix=/usr/lib/php701    \
--with-apxs2=/usr/local/apacheALL2412/bin/apxs   \
--sysconfdir=/usr/lib/php701/phpini    \
--localstatedir=/var     \
--datadir=/usr/share/php       \
--mandir=/usr/share/man        \
--enable-fpm     \
--with-fpm-user=apache2412      \
--with-fpm-group=apache2412     \
--with-config-file-path=/usr/lib/php701/phpini      \
--with-zlib     \
--enable-bcmath      \
--with-bz2       \
--enable-calendar      \
--enable-dba=shared     \
--with-gdbm      \
--with-gmp       \
--enable-ftp      \
--with-gettext     \
--enable-mbstring     \
--with-libxml-dir=/usr/lib/php701/xml2     \
--enable-xml      \
 --with-curl=/opt/curlssl/     \
 --with-mysql      \
 --with-mysql-sock=/var/lib/mysql/mysql.sock     \
 --with-mysqli      \
 --enable-mysqlnd     \
 --with-openssl=/usr     \
 --with-openssl-dir=/usr/bin     \
 --with-pdo-mysql      \
--with-readline &&       \
make

I have tried different values of "--with-openssl" and "--with-openssl-dir" but I still get the error below.

Here is the error:

ext/openssl/.libs/xp_ssl.o: In function `php_openssl_setup_crypto':
/Timstmp/PHP701-Source/php-7.0.1/ext/openssl/xp_ssl.c:1599: 
undefined reference to `SSL_CTX_set_alpn_protos'
/Timstmp/PHP701-Source/php-7.0.1/ext/openssl/xp_ssl.c:1604: 
undefined reference to `SSL_CTX_set_alpn_select_cb'
ext/openssl/.libs/xp_ssl.o: In function `php_openssl_sockop_set_option':
/Timstmp/PHP701-Source/php-7.0.1/ext/openssl/xp_ssl.c:2305: 
undefined reference to `SSL_get0_alpn_selected'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1 
  • 写回答

1条回答 默认 最新

  • dongxichan8627 2016-01-10 10:22
    关注

    i also use the openssl 1.0.1e, and i meet this also. You could found the solution here : https://www.inaruto.com/2016-01-09/php7%E5%AE%89%E8%A3%85%E7%9A%84%E5%90%84%E7%A7%8D%E6%A2%97/

    See the section 3, you should compile the new version of curl and then just specified the curl path with (with-curl= ???), compile php7.x again。

    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题