llama-cpp-php icon indicating copy to clipboard operation
llama-cpp-php copied to clipboard

[Bug]: running on Docker

Open yandod opened this issue 1 year ago • 2 comments

What happened?

I am trying this library on Docker on mac and happened to see this error on test. I knew this library is tested on Linux only, but I wonder is it possible to run on Docker image.

% make test
docker compose run php php ./test.php

Fatal error: Uncaught FFI\Exception: Failed loading '/var/www/html/vendor/kambo/llama-cpp-php-linux-lib/src/../libllama.so' in /var/www/html/vendor/kambo/llama-cpp-php/src/Native/LLamaCPPFFI.php:59 Stack trace: #0 /var/www/html/vendor/kambo/llama-cpp-php/src/Native/LLamaCPPFFI.php(59): FFI::cdef('#define FFI_LIB...', '/var/www/html/v...') #1 /var/www/html/vendor/kambo/llama-cpp-php/src/Native/LLamaCPPFFI.php(49): Kambo\LLamaCPP\Native\LLamaCPPFFI::createWithLibraryInPath('/var/www/html/v...') #2 /var/www/html/vendor/kambo/llama-cpp-php/src/Native/LLamaCPPFFI.php(30): Kambo\LLamaCPP\Native\LLamaCPPFFI::create() #3 /var/www/html/vendor/kambo/llama-cpp-php/src/Context.php(35): Kambo\LLamaCPP\Native\LLamaCPPFFI::getInstance() #4 /var/www/html/test.php(10): Kambo\LLamaCPP\Context::createWithParameter(Object(Kambo\LLamaCpp\Parameters\ModelParameters)) #5 {main} thrown in /var/www/html/vendor/kambo/llama-cpp-php/src/Native/LLamaCPPFFI.php on line 59 make: *** [test] Error 255

How to reproduce the bug

here is my docker environment code. https://github.com/yandod/php-machine-learning

run

make install
make download
make test

Package Version

dev-main

PHP Version

8.2

Which operating systems does with happen with?

macOS

Notes

No response

yandod avatar Sep 20 '23 09:09 yandod