Skip to content

Conversation

@nfreader
Copy link

Hello!

I ran into an issue where I assumed ffi was properly enabled; it was not and I spent many hours trying to debug the problem. This PR reworks the section of the readme that talks about enabling FFI. I've also added an ini_get check in the FFI class that handles loading libraries. Right now it just appends to the message thrown by the exception, but it might work better as its own exception.

}
$msg .= ". Make sure that you've installed libvips and that '$vips_libname'";
$msg .= " is on your system's library search path.";
if ('preload' === ini_get('ffi.enable')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about moving this up a bit? On line 284 we have:

        if (!ini_get('ffi.enable')) {
            throw new Exception("ffi.enable not set to 'true'");
        }

We could change that to:

        if (!ini_get('ffi.enable') ||
            ini_get('ffi.enable') === 'preload') {
            throw new Exception("ffi.enable not set to 'true'");
        }

I think (I think??) we need both tests.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That’s probably a better place for it, I just worry about unintended consequences. I don’t know enough about FFI to fully grasp what this might mean later on down the line.

@jcupitt
Copy link
Member

jcupitt commented Dec 28, 2025

Ahh how annoying, I'm sorry that bit you. Yes, happy to accept this PR.

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.

2 participants