Quantcast
Channel: Matomo forums - Latest topics
Viewing all articles
Browse latest Browse all 13973

Class 'Piwik FrontController' not found

$
0
0

@shweta wrote:

Hello
I have installed piwik 2.17.0
And trying to add user using API Request but it is giving me following error -
Piwik encountered an error: Class 'Piwik FrontController' not found (which lead to: The root container has not been created yet.)

What it means, Please help where i am wrong?
here is my PHP code script -

if(!defined('PIWIK_INCLUDE_PATH'))
{
define('PIWIK_INCLUDE_PATH', '/shw_piwik_test/piwik/');
}
if(!defined('PIWIK_USER_PATH'))
{
define('PIWIK_USER_PATH', '/shw_piwik_test/piwik/');
}
require_once PIWIK_INCLUDE_PATH . "index.php";
require_once PIWIK_INCLUDE_PATH . "core/API/Request.php";
Piwik_FrontController::getInstance()->init();
$request = new Request('
method=UsersManager.addUser
&userLogin=XXX
&password=XXX
&email=XXX
&alias=shwtest
&access=view
&idSites=1
&token_auth=XXXX
');
// Calls the API and fetch XML data back
$result = $request->process();
echo "process result -- ".$result ;

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 13973

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>