You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.
Hello guys i have a problem using the PHP_Client.
On my Xampp Local Machine (Windows 10) everthing works great. But if i put the exact same files on my Linux VPS the Server gives me a 500 Code:
Can someone maybe help me ?
Here ist my Code:
<?php
require __DIR__ . '\..\vendor\autoload.php';
use InfluxDB2\Client;
use InfluxDB2\Model\WritePrecision;
use InfluxDB2\Point;
echo getdata("Jürgen ", "M_AC_Power");
function getdata($kunde,$wert)
{
# You can generate a Token from the "Tokens Tab" in the UI
$token = '';
$org = 'JH';
$bucket = 'PV-Daten';
$client = new Client([
"url" => "http://95.111.224.215:8086",
"token" => $token,
]);
$query = '
from(bucket: "PV-Daten")
|> range(start: -5s)
|> filter(fn: (r) => r["name"] == "'.$kunde.'")
|> filter(fn: (r) => r["_field"] == "'.$wert.'")
|> last()
';
$tables = $client->createQueryApi()->query($query, $org);
if (isset($tables[0])) {
$data = ($tables[0]);
$data = $data->records;
$data = ($data[0]);
return ($data->getValue());
} else {
return ("fail");
}
}
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello guys i have a problem using the PHP_Client.
On my Xampp Local Machine (Windows 10) everthing works great. But if i put the exact same files on my Linux VPS the Server gives me a 500 Code:
Can someone maybe help me ?
Here ist my Code:
The text was updated successfully, but these errors were encountered: