amphp / ext-uv

Other
191 stars 28 forks source link

Debian 9.8 + PHP 7.3.4 - Compile Error - recipe for target 'php_uv.lo' failed #65

Closed TCB13 closed 5 years ago

TCB13 commented 5 years ago

I was trying to get this extension under Debian, so I did:

apt install libuv1 libuv1-dev
pecl install "channel://pecl.php.net/uv-0.2.2"

However the output was:

In file included from /usr/include/php/20180731/main/php.h:38:0,
                 from /tmp/pear/temp/uv/php_uv.h:32,
                 from /tmp/pear/temp/uv/php_uv.c:21:
/usr/include/php/20180731/Zend/zend_API.h:705:39: note: declared here
 ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_error(int num, char *name, zval *arg);
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Makefile:195: recipe for target 'php_uv.lo' failed
make: *** [php_uv.lo] Error 1
ERROR: `make' failed

From other posts I was under the impression that the issue was my libuv version, however I'm not sure. Any tips? Thank you.

My system:

Debian GNU/Linux 9.8 (stretch)
PHP 7.3.4-1+0~20190412071350.37+stretch~1.gbpabc171 (cli) (built: Apr 12 2019 07:13:50) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.4, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.4-1+0~20190412071350.37+stretch~1.gbpabc171, Copyright (c) 1999-2018, by Zend Technologies
TCB13 commented 5 years ago

I also tired to install libuv from here http://downloads.datastax.com/cpp-driver/ubuntu/16.04/dependencies/libuv/v1.11.0/ and got the same result.

Also got the same result with compilation / installing from source with:

wget http://dist.libuv.org/dist/v1.8.0/libuv-v1.8.0.tar.gz
tar xzf libuv-v1.8.0.tar.gz
cd libuv-v1.8.0/
sh autogen.sh
./configure
make install

I guess the issues isn't related to libuv at all.


The official instructions in the readme seem to work:

git clone https://github.com/bwoebi/php-uv.git
cd php-uv
phpize
./configure
make
make install
# add `extension=uv.so` to your php.ini

However when I load it into php ratchet, I get Segmentation fault.

bwoebi commented 5 years ago

I need to create a new pecl release. Will do so later.

As for the segfault, can you please provide me a stacktrace / reproduce script? Thanks.

TCB13 commented 5 years ago

@bwoebi you can find attached a simple test. Just run composer, server.php and then client.html. The client will try to connect to the web socket server and it will fail with segfaultw whenever php-uv is used. ---file updated bellow---

bwoebi commented 5 years ago

@TCB13 ChatServerTest.php is missing in the zip?

bwoebi commented 5 years ago

Regarding the compile error, I have uploaded 0.2.3 to pecl.

TCB13 commented 5 years ago

@bwoebi oh I'm sorry, my bad. Here is an update: php-uv-crash-test-1.zip Meanwhile, thank you for the pecl.

bwoebi commented 5 years ago
uv_loop_new found!
new user connected: 48 Total connections: 1
new user connected: 77 Total connections: 2

I can't reproduce any crash.

TCB13 commented 5 years ago

@bwoebi maybe the last pecl fixes the issue? I'll test it tomorrow. Thank you.

TCB13 commented 5 years ago

@bwoebi just installed from pecl and it works just fine. Thank you.