Skip to content

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

@wigglitch

Description

@wigglitch

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions