Answer the question
In order to leave comments, you need to log in
Why doesn't yii2 see classes on hosting?
I connected the extension via composer: $ composer require telegram-bot/api
Then in the controller modules\admin\controllers\BetController.php I execute:
use \TelegramBot\Api\BotApi;
...
//Действия с ботом
Class 'TelegramBot\Api\BotApi' not found
Answer the question
In order to leave comments, you need to log in
1) Opcache cleared?
2) Have the authoritative compositor maps been rebuilt?
I would launch
and then look for this class in vendor/composer/autoload_classmap.php to understand how the composer loaded it and in what namespace
Register! Check the name of the folders, if the namespace contains the path \TelegramBot\Api\BotApi, then the path through the directories should also be capitalized. The difference between hosting and non-hosting is in the operating system and its file system. On windows, the paths are case-insensitive, on unix, on the contrary, in most cases, the file system, comparing the path TelegramBot\Api and telegramBot\api, sees two completely different paths.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question