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

Fatal error: Uncaught FFI\Exception: Failed resolving C function 'printf' on Windows #213

Open
effectzer0 opened this issue Jul 26, 2023 · 2 comments

Comments

@effectzer0
Copy link

Hello! I'm using Windows 10 21H1 (19043.1889), PHP 8.1 and vips 8.14.1 and unfortunately I can't use your library because of the following error:

Fatal error: Uncaught FFI\Exception: Failed resolving C function 'printf' in C:\Users\admin\test_vips_win\vendor\jcupitt\vips\src\FFI.php:208
Stack trace:
#0 C:\Users\admin\test_vips_win\vendor\jcupitt\vips\src\FFI.php(208): FFI::cdef('    int printf(...')
#1 C:\Users\admin\test_vips_win\vendor\jcupitt\vips\src\FFI.php(116): Jcupitt\Vips\FFI::init()
#2 C:\Users\admin\test_vips_win\vendor\jcupitt\vips\src\VipsOperation.php(80): Jcupitt\Vips\FFI::vips()
#3 C:\Users\admin\test_vips_win\vendor\jcupitt\vips\src\VipsOperation.php(225): Jcupitt\Vips\VipsOperation::newFromName('thumbnail')
#4 C:\Users\admin\test_vips_win\vendor\jcupitt\vips\src\Image.php(1290): Jcupitt\Vips\VipsOperation::callBase('thumbnail', NULL, Array)
#5 C:\Users\admin\test_vips_win\test.php(5): Jcupitt\Vips\Image::__callStatic('thumbnail', Array)
#6 {main}
  thrown in C:\Users\admin\test_vips_win\vendor\jcupitt\vips\src\FFI.php on line 208

The binary itself is located at C:\vips\bin and this directory is specified in PATH and PHP has access to the vips binaries:

PS C:\Users\admin\test_vips_win> php -r "passthru('vips -v');"
vips-8.14.1

FFI is also enabled:

PS C:\Users\admin\test_vips_win> php -r "echo (int) ini_get('ffi.enable');"
1

I have already seen a previous issue on this topic and I even received an email when you closed it as fixed however in my case unfortunately nothing has changed. Am I doing something wrong? Please help me

@jcupitt
Copy link
Member

jcupitt commented Jul 26, 2023

Hello @swaro32, I guess you are using an older version of php-vips, the printf test was removed a while ago.

@effectzer0
Copy link
Author

That's the first thing I thought of. The version is 2.1.1, the newest according to packagist. Maybe it has an older version than the master github branch?

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

No branches or pull requests

2 participants