Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add dlerror() information #32

Merged
merged 1 commit into from
Jul 20, 2022
Merged

add dlerror() information #32

merged 1 commit into from
Jul 20, 2022

Conversation

Erikvv
Copy link
Collaborator

@Erikvv Erikvv commented Jun 25, 2022

When the uplink library cannot be loaded, there is currently a generic
message originating from PHP. This is in all PHP versions.

This change adds extra information which will help the user diagnose the
issue.

Example of old output:

Fatal error: Uncaught FFI\Exception: Failed loading '/app/build/libuplink-x86_64-linux.so' in /app/src/Uplink.php:42

Example of new output:

Fatal error: Uncaught FFI\Exception: Failed loading '/app/build/libuplink-x86_64-linux.so'. /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /app/build/libuplink-x86_64-linux.so) in /app/src/Uplink.php:60

Fixes #21

src/Uplink.php Outdated Show resolved Hide resolved
mniewrzal
mniewrzal previously approved these changes Jul 5, 2022
src/Uplink.php Outdated Show resolved Hide resolved
egonelbre
egonelbre previously approved these changes Jul 20, 2022
When the uplink library cannot be loaded, there is currently a generic
message originating from PHP. This is in all PHP versions.

This change adds extra information which will help the user diagnose the
issue.

Example of old output:

Fatal error: Uncaught FFI\Exception: Failed loading '/app/build/libuplink-x86_64-linux.so' in /app/src/Uplink.php:42

Example of new output:

Fatal error: Uncaught FFI\Exception: Failed loading '/app/build/libuplink-x86_64-linux.so'. /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /app/build/libuplink-x86_64-linux.so) in /app/src/Uplink.php:60

Fixes #21
@Erikvv
Copy link
Collaborator Author

Erikvv commented Jul 20, 2022

Did dlclose() a little different to please PHPStan

@Erikvv Erikvv merged commit 8cb12c3 into main Jul 20, 2022
@Erikvv Erikvv deleted the dlerror branch July 20, 2022 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve error when dlopen() fails
3 participants