Note that getLastError() doesn't work if you run multiple queries with runQueries(). It doesn't return any error, even if one or several (or all) of the queries failed.
PHP - Manual: SphinxClient::getLastError
2024-12-22
(PECL sphinx >= 0.1.0)
SphinxClient::getLastError — Get the last error message
Returns string with the last error message. If there were no errors during the previous API call, empty string is returned. This method doesn't reset the error message, so you can safely call it several times.
此函数没有参数。
Returns the last error message or an empty string if there were no errors.
Note that getLastError() doesn't work if you run multiple queries with runQueries(). It doesn't return any error, even if one or several (or all) of the queries failed.
官方地址:https://www.php.net/manual/en/sphinxclient.getlasterror.php