I have uguranyum/yii2-icalender installed. I run it from console. It works just fine on my local machine. But on the remote site, I get the error:
2019-08-28 12:00:02 [-][-][-][error][Error] Error:
Class 'uguranyum\icalender\iCalender' not found
in /var/www/vhosts/mySite/httpdocs/console/controllers/CalendarController.php:28
Stack trace:
#0 /var/www/vhosts/mySite/httpdocs/console/controllers/CalendarController.php(64): console\controllers\CalendarController->actionInit('2019-08-28', '2019-08-28')
#1 [internal function]: console\controllers\CalendarController->actionIndex()
#2 /var/www/vhosts/mySite/httpdocs/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#3 /var/www/vhosts/imySite/httpdocs/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#4 /var/www/vhosts/mySite/httpdocs/vendor/yiisoft/yii2/console/Controller.php(148): yii\base\Controller->runAction('index', Array)
I’ve checked the namespace and have tried changing the file permissions. I’m not sure what else to look for.
use common\models\Utility;
use common\models\group\IcalenderMain;
use common\models\group\GroupIcalendarUrl;
use fedemotta\cronjob\models\CronJob;
use uguranyum\icalender\iCalender;
use yii\console\Controller;
class CalendarController extends Controller
{
/**
* Clean iCalendar tables and do a fresh import for all icalendar urls
* @param string $from
* @param string $to
* @return int exit code
*/
public function actionInit($from, $to) {
$dates = CronJob::getDateRange($from, $to);
$command = CronJob::run($this->id, $this->action->id, 0, CronJob::countDateRange($dates));
if ($command === false) {
return Controller::EXIT_CODE_ERROR;
} else {
foreach ($dates as $date) {
iCalender::cleanTables();