• Start

Languages

/

PHP

/

Methods

health

Check the storage layer health of a local or remote database using the health method with the SurrealDB PHP SDK.

This method checks wether the database is running and the storage engine is running.

Method Syntax

$db->health();
$health = $db->health();
echo "The health status is: $health."; // 200 or 500

The health function returns 200 if the database is running and is in good shape. 500 if a failure occurred.

Was this page helpful?