@Alex Thanks for your help, I have included init.php
require_once ('../init.php');
Then the above error not coming now. Now this is working fine.
Now I have another problem like if I use file_get_-contents,
require_once ('../config/config.inc.php');
require_once ('../init.php');
$json = file_get_contents('php://input');
$data = json_decode($json);
Now I couldn't access the $data variable, it's showing empty. I have checked without include config on this case this file_get_contents is working fine.