Ofc, u can build anything with anything, that being said, there are better alternatives.
Yes, it sucks, but it works.
https://github.com/HelgeSverre/local-llm-php
GitHubGitHub - HelgeSverre/local-llm-php: Local llama.cpp runtime for PHP via FFI with GGUF support, streaming, profiling, and Ollama benchmarks.Local llama.cpp runtime for PHP via FFI with GGUF support, streaming, profiling, and Ollama benchmarks. - HelgeSverre/local-llm-php