-
Notifications
You must be signed in to change notification settings - Fork 26
FFI\\Exception(code: 0): Failed loading 'libvips.42.dylib' after upgrade to v2 on M1 Mac #178
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
Comments
Ok, so in FFI.php, starting on line 729...
For my particular situation, these three variables On the PHP website, the second parameter for
It doesn't say the absolute path, so presumably my system doesn't know where to look for shared libraries. But it seems to work with the absolute path, so maybe we can change that? I've changed this on 236:
And also this on 729
I've tested on a Mac M1 Studio, Intel Macbook Pro and Ubuntu 20.04 LTS and it works, not sure about other systems - probably need to test on Windows. Let me know if you want me to do a PR or maybe I need to just figure out how to configure php to see the shared libraries? |
Hi @johnvoncolln, sorry for not having replied to this sooner.
I think php-vips is already doing what you want, isn't it? git master looks like this: https://github.com/libvips/php-vips/blob/master/src/FFI.php#L247-L256 It's trying a set of absolute paths, one of which is the homebrew M1 area. Could you check that you are using the latest php-vips? We're on 2.1.1 right now. You probably found, but you can set a debug logger, eg.: #!/usr/bin/env php
<?php
require __DIR__ . '/vendor/autoload.php';
use Jcupitt\Vips;
Vips\Config::setLogger(new Vips\DebugLogger());
$image = Vips\Image::newFromFile($argv[1], ['access' => 'sequential']); Run with eg.:
And you should be able to see it searching the various possible lib areas. |
No problem at all! Thanks for helping me out. my php-vips is at 2.1.0 After I revert back to original code in FFI.php and run it with debugger, this is the output:
So it looks like it's loading it where it's creating
But it fails later on here (line 729ish):
But your not specifying the absolute path, just the library name on the second parameter of |
So if you're specifying the absolute path in one place, should you not be specifying it elsewhere? |
Reporting the exact issue. PHP 8.2 My temporary workaround (added path):
|
I've bought an M2 mac and made #206 which I think fixes this. Any testing very welcome! |
... let's close this issue and move discussion to that PR. |
Have read through this issue and tried everything, but haven't had any luck...
I've enabled FFI as instructed.
I've removed the older vips php extension.
libvips is 8.13.3
php-vips is 2.1.0
php is 8.1
Any ideas on things I can try to troubleshoot? All out of ideas at the moment.
The text was updated successfully, but these errors were encountered: