This is archived documentation for InfluxData product versions that are no longer maintained. For newer documentation, see the latest InfluxData documentation.

There’s a PHP InfluxDB library on GitHub thanks to C├ęsar D. Rodas.

Installation (using composer)

composer require crodas/influx-php:\*



$client = new \crodas\InfluxPHP\Client(
    "localhost", // host
    8086,        // port
    "root",      // user
    "root"       // password

Creating a Database


$db = $client->createDatabase("foobar");
$db->createUser("user", "pass");

Inserting Data


$db = $client->foobar;
$db->insert("some label", ['foobar' => 'bar']);



$db = $client->foobar;

foreach ($db->query("SELECT * FROM foo;") as $row) {
    var_dump($row, $row->time);

Be a fantastic human and contribute to these docs.