r/PHPhelp • u/RefrigeratorOk3257 • Oct 20 '25
PHP FFI not linking dependent shared libraries (Windows & macOS)
Hi everyone,
I’ve run into a strange issue with PHP FFI on both Windows and macOS. When I load a shared library (for example libssl, libavcodec, etc.), FFI doesn’t recognize or link its dependent libraries like libcrypto or libavutil.
The same code works perfectly on Linux, there, FFI automatically resolves and links all dependencies.
Here’s the GitHub issue with more details:
https://github.com/PHP-WebRTC/webrtc/issues/3
The only workaround I’ve found is to load each library separately and manually cast objects between them, but it’s not a clean solution.
Has anyone else experienced this or found a reliable workaround on Windows or macOS?
View all comments
Show parent comment
1
u/RefrigeratorOk3257 Oct 20 '25
Thanks! I’ll hop over to phpc.chat and ask there, appreciate the tip