D
D
Daniil Sidorov2018-08-09 20:28:48
Yii
Daniil Sidorov, 2018-08-09 20:28:48

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;
...
//Действия с ботом

Everything works fine on localhost, but not on hosting. Writes the following:
Class 'TelegramBot\Api\BotApi' not found
Although the files are all transferred. I think that the problem is in the case of letters, but I can not understand where. Help plz.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
Kirill Nesmeyanov, 2018-08-09
@SerafimArts

1) Opcache cleared?
2) Have the authoritative compositor maps been rebuilt?

Z
ZloAdmin, 2018-08-09
@ZloAdmin

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

V
Vladimir Soldatov, 2018-08-14
@TPbIHTPABA

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 question

Ask a Question

731 491 924 answers to any question