dongshadu4498 2017-10-02 08:57
浏览 77
已采纳

PHP无法找到类(composer autoloader,slim framework)

I'm developing an application via Slim framework and I made my classes to be loaded with composer.

When I'm running it locally via xampp, it totally works, but as soon as I upload it on a web storage, the following error occurs.:

Type: Error
Message: Class 'App\Controllers\UserController' not found
File: /some/path/backend/src/controllers.php
Line: 8

I uploaded my vendor directory also. Checked get_declared_classes() result, and my classes are actually not loaded. Could you make a hint, that where should I search for the solution?

Kind regards, Daniel.

  • 写回答

1条回答 默认 最新

  • duankanyi6539 2017-10-02 09:09
    关注

    Since you are programming locally using Windows and on server there is Linux, check that namespace and directory has same CamelCase naming, because Linux is case sensitive while Windows is case insensitive.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?