![]() |
I want to use the influxdb-php class in CI4:
https://github.com/influxdata/influxdb-php I tried calling the class from the controller using: PHP Code: use InfluxDB; But no success. I installed it using composer: Code: composer require influxdb/influxdb-php
I'm still getting the following error:
Code: Class "InfluxDB\Client" not found When using: PHP Code: use InfluxDB\Client;
CI 4.2.0 installed via composer (updated to 4.2.1)
influxdb/influxdb-php - installed via composer. Works. Have you done any manipulations with the structure of the application?
By default, the vendor directory (where the composer stores the autoloader and packages) is in the root directory.
If you have changed the directory structure, you must ensure that the COMPOSER_PATH constant (app/Config/Constants.php) points to the correct path for the composer autoloader.
It appears to be fine:
defined('COMPOSER_PATH') || define('COMPOSER_PATH', ROOTPATH . 'vendor/autoload.php'); I have myth-auth installed and operational as well through composer. So I don't understand why specifically the InfluxDB client won't load.
"Solved" is by re-creating a new CI4 install, installing the required packages using composer, and copying over the controllers, models, views etc. from the original install. It works now...
![]() |
Welcome Guest, Not a member yet? Register Sign In |