tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
7.11k stars 1.44k forks source link

[help wanted] Cannot load builded library in PHP 8.1 using FFI #2268

Closed mgluesenkamp closed 1 year ago

mgluesenkamp commented 1 year ago

Hi,

I builded the library with the help of the build instructions at https://tdlib.github.io/td/build.html?language=PHP. The build works without any problems, but I can't load my builded libtdjson.so.1.8.0 by FFI in PHP. But I always got the following error:

FFI\Exception {#634
  #message: "Failed loading '/var/www/alexa-skill-telegram/var/tdlib/libtdjson.so.1.8.0'"
  [...]

I tried several other possibilities, but I run out of ideas:

Are there any restrictions in PHP to make it work or builded it wrong? Thank you for any advise!

levlam commented 1 year ago

Check that ldd /var/www/alexa-skill-telegram/var/tdlib/libtdjson.so.1.8.0 shows no missing dependencies.

You can also compare your FFI usage with code of other wrappers from https://github.com/tdlib/td/tree/master/example#using-tdlib-in-php-projects.

mgluesenkamp commented 1 year ago

Ah, thank you for the ldd command. I did not know this command. It misses libssl.so.3 and libcrypto.so.3. The normal PHP docker container does not provite openssl 3 features. So I have to build my own one. Thanks! Issue can be closed. :)