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 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作