meilisearch-php: Meilisearch giving error 405 http status
Hi dears , meilisearch giving such error when search (request type post)
Fatal error: Uncaught Meilisearch InvalidResponseBodyException: Http Status: 405 thrown in /var/www/html/vendor/meilisearch/meilisearch-php/src/Http/Client.php on line 186
This error dont giving in meilisearch itself servise (related 127.0.0.1:7700)
VPS info:
4 cores | RAM 8 GB | 100 GB (100% NVMe) | 200 Mbit/s
Also i connect meilisearch from php with docker
Docker conf is:
meilisearch:
image: 'getmeili/meilisearch:latest'
ports:
- '7700:7700'
volumes:
- './Docker/meilisearch/volume/:/meili_data'
networks:
customnetwork:
ipv4_address: 172.20.0.13
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--spider", "5"]
retries: 3
timeout: 5s
Connection define is :
<?php
MEILISEARCH_CONNECT = 'http://172.20.0.13:7700';
const MEILISEARCH_MASTER_KEY = 'masterKey';
const MEILISEARCH_INDEX_KEY = 'products';
- OS: [Ubuntu 22]
- Meilisearch version: [v.0.28.1]
- meilisearch-php version: [packagist v0.24.0]
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 27 (9 by maintainers)
If you want to use a plain curl is up to you, but the idea of our SDKs is to help you integrate with Meili easily đ
So, I spotted some trouble in your environment.
First, you must use a version of the Meilisearch engine that is compatible with meilisearch-php. So if you have the engine version 0.27, you should stay on the version of meilisearch-php you have.
But I assume you are using the new version of Meili, so you should run
composer update meilisearch/meilisearch-php
to get the meilisearch-phpv0.24.0
, this should solve your problem.Btw: Our docs only show the latest version of the Meilisearch engine, thatâs why you got these issues đ.
I understand your frustration, but you need to know that
latest
tag behavior is not something we can control, because it entirely depends on the usersâ environment (unfortunately).I also suggested the docs team change that instruction from the main docs website https://docs.meilisearch.com/learn/getting_started/quick_start.html#setup-and-installation if you check it out, youâll see a specific tag currently
v0.28.0
instead oflatest
to prevent that from happening.Thatâs a pretty good idea, and this could also be applied to other SDKs (we received this kind of feedback before). Unfortunately, due to some time restrictions, we did not have enough time to create a solid plan to implement it yet.
Thanks for using Meilisearch đ¤
Hi @brunoocasali I have same trouble:
Error notice:
MeiliSearch\Exceptions\InvalidResponseBodyException
In
Laravel version: 8.* Package version: â0.28.1â âmeilisearch/meilisearch-phpâ: â^0.24.1â,
My code version one:
My code version two:
I need custom sorting and filtering. But in both code versions I have the error
MeiliSearch\Exceptions\InvalidResponseBodyException
But if I use simple code itâs worked fine:
return Movie::search($q)->get();
I will check in next project đ Thanks for helping again ! đ