Home  >  Article  >  Backend Development  >  What are the reasons for laravel5 error message 'The calling class does not exist'?

What are the reasons for laravel5 error message 'The calling class does not exist'?

黄舟
黄舟Original
2017-10-13 09:29:434406browse

What are the reasons for laravel5 error message 'The calling class does not exist'?

Error message under laravel5.5 - the calling class does not exist

1. Problem background

Often after we develop a project under local windows, we test it very carefully and there are no problems, and then we go online with confidence. As a result, when we test the online version, various errors are reported, and the shadow area in our hearts changes. As this situation happened again and again and expanded again and again, I couldn't bear it anymore, so I made up my mind to use the Linux environment for offline development in the future. However, after stepping on so many pitfalls, I still record my experience and contribute to those who come after me.

2. The situation where the class cannot be found

1. Mentally retarded error 1: Wrong type of class name;

2. Mentally retarded error 2: Class The calling path is written incorrectly;

3. Common error 1: The case of the class name is not exactly the same;

4. Common error 2: There are syntax errors in the class file;

5. Uncommon error 1: "." is not allowed in laravel's class file name. For example, the class file format in TP3 is xxx.class.php. An error will be reported for such a file in laravel. The class file in laravel The name can only be xxx.php;

6. Uncommon error 2: Some third-party extension classes supported by laravel are called, but there is no composer Install to install them. In this case, go to the project root directory and update it. Composer is enough.

7. Uncommon error 3: The manually created class file is not placed in the container by the Laravel framework, and the class file cannot be found when it is referenced. At this time, composer update needs to be executed to update the Laravel container.

The above are pitfalls that I have stepped on. Regardless of whether I am mentally retarded or not, I have stepped on them all. After all, I am still young...

For more related knowledge, please visit PHP Chinese website ! !

The above is the detailed content of What are the reasons for laravel5 error message 'The calling class does not exist'?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn