Swoole-src: Does v2.1.1 supports build with option --enable-openssl on php 7.2?

Created on 19 Mar 2018  ·  4Comments  ·  Source: swoole/swoole-src

  1. What did you do? If possible, provide a recipe for reproducing the error.

Hi All! I need ssl support in swoole, and therefore i downloaded last version (2.1.1) and configured it with params ./configure --enable-sockets --enable-openssl --with-php-config=/usr/bin/php-config7.2

error occured when i runned ./make.sh

  1. What did you expect to see?

I expected successfully built swoole application with ssl option

  1. What did you see instead?

After ./make.sh I got two errors:

In file included from /home/pavel/work/swoole-src-2.1.1/swoole_coroutine.c:17:0:
/home/pavel/work/swoole-src-2.1.1/php_swoole.h:136:2: error: #error "Enable sockets support, require sockets extension."
#error "Enable sockets support, require sockets extension."
^
/home/pavel/work/swoole-src-2.1.1/php_swoole.h:142:2: error: #error "Enable http2 support, require nghttp2 library."
#error "Enable http2 support, require nghttp2 library."

I tried to install php7.2-sockets manually, but installer notified, that instead php7.2-sockets it will use php7.2-common and there is nothing to install.

With second error I have no idea too: I installed nghttp2 with command apt install nghttp2 but still got an error.

What I am doing wrong? And what I need to do to solve this problems?

  1. What version of Swoole are you using (php --ri swoole)?

v2.1.1

  1. What is your machine environment used (including version of kernel & php & gcc) ?

php 7.2 on Ubuntu 16.04;

kernel: Linux nataly-nb.lo 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

  1. If you are using ssl, what is your openssl version?

OpenSSL 1.1.0g 2 Nov 2017

wontfix

Most helpful comment

for the nghttp2 do:
apt install libnghttp2-dev

im definitely not sure about the sockets thing case im getting the error for that too. Im not sure why this hasnt been attempted to be patched

All 4 comments

Please try --with-openssl-dir:

./configure --enable-openssl -with-openssl-dir=/usr/lib/ -with-php-config=/usr/bin/php-config7.2

Thanks to emdfreeman. But this solution doesn't helps...

UPD

I tried to build swoole with the same config on Centos system and it works!!!

So... My first fault was the i runned ./make.sh instead of make.

The second I don't know why, but on ubuntu i have to hack file php_swoole.h to build swoole with ssl support.

Like written in https://github.com/swoole/swoole-src/issues/1403 and https://github.com/youzan/zan/issues/7 I added #define HAVE_SOCKETS 1 right after #ifdef SW_SOCKETS string and then swoole was compilled successful.

I think, this is not good, but the only fast solution for this problem.

for the nghttp2 do:
apt install libnghttp2-dev

im definitely not sure about the sockets thing case im getting the error for that too. Im not sure why this hasnt been attempted to be patched

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jerryli1 picture jerryli1  ·  4Comments

nick-zh picture nick-zh  ·  3Comments

lotarbo picture lotarbo  ·  4Comments

apetab picture apetab  ·  4Comments

morozovsk picture morozovsk  ·  3Comments