danog / php-libtgvoip

PHP extension that wraps the telegram VoIP library.
https://voip.madelineproto.xyz
GNU Affero General Public License v3.0
24 stars 5 forks source link

php error with libtgvoip.so #10

Closed afeno closed 4 years ago

afeno commented 4 years ago

Hello, I'm having a problem after installing (sudo make install) the new version of libtgvoip.

Error when executing php:

$ php
PHP Warning:  PHP Startup: Unable to load dynamic library 'libtgvoip.so' (tried: /usr/lib/php/20180731/libtgvoip.so (/usr/lib/php/20180731/libtgvoip.so: undefined symbol: _ZTVN6tgvoip14NetworkAddressE), /usr/lib/php/20180731/libtgvoip.so.so (/usr/lib/php/20180731/libtgvoip.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Segmentation fault (core dumped)

My setup:

$ php -i
phpinfo()
PHP Version => 7.3.19-1+ubuntu18.04.1+deb.sury.org+1

System => Linux ip-172-31-33-165 4.15.0-1065-aws #69-Ubuntu SMP Thu Mar 26 02:17:29 UTC 2020 x86_64
Build Date => Jun 12 2020 07:48:30
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /etc/php/7.3/cli
Loaded Configuration File => /etc/php/7.3/cli/php.ini
Scan this dir for additional .ini files => /etc/php/7.3/cli/conf.d

What can cause this error? It was not happening before with the previous version of php-libtgvoip....

Thank you! Best Regards Alfredo Fenoglio

danog commented 4 years ago

You should recompile the extension, if it still happens use gdb to debug

afeno commented 4 years ago

I don't get any error when recompiling the libtgvoip.so library. But after installing it (sudo make install) then I get the error when executing PHP. PHP Startup: Unable to load dynamic library 'libtgvoip.so' (tried: /usr/lib/php/20180731/libtgvoip.so (/usr/lib/php/20180731/libtgvoip.so: undefined symbol: _ZTVN6tgvoip14NetworkAddressE)

Do you know what I mean?

danog commented 4 years ago

You should remove completely the php-libtgvoip directory and re-download it using the specified command

afeno commented 4 years ago

Yes. This is what I did. I remove the php-libtgvoip and then clone the repository from githab from scratch before recompiling. It is strange the the "make" is running smoothly without errors but the error is really coming when I execute the php from cli after doing the sudo make install.

afeno commented 4 years ago

Hi, I have just reinstalled php and everything is working now. It seems that there was a problem with a mix between php 7.3 and php 7.4. Problem resolved now with only php 7.4 installed from scratch.