Home > Backend Development > PHP Problem > How to solve the problem that php cannot find the class

How to solve the problem that php cannot find the class

藏色散人
Release: 2023-03-07 20:48:02
Original
3771 people have browsed it

The solution to the problem that php cannot find a class: first open the error file; then temporarily remove the "try catch"; then print the included file before "new SmsSingleSender()"; and finally use include correctly.

How to solve the problem that php cannot find the class

Recommended: "PHP Video Tutorial"

The operating environment of this tutorial: Windows 7 system, PHP version 5.6, This method works for all brands of computers.

Specific question:

php prompts that the class cannot be found

The code is as follows: (In phpstorm, both ctrl and left keys are You can enter this category)

How to solve the problem that php cannot find the class

How to solve the problem that php cannot find the class

The Tencent SMS sdk I use, I haven’t changed much~, I don’t know why. It’s an error

Solution:

I encountered a similar problem last time. I looked at the code and included the class, but the error was saying not found

You can temporarily remove the try.. catch and print out which files are included before new SmsSingleSender().

echo "<pre class="brush:php;toolbar:false">";
print_r(get_included_files());//打印所有加载文件
exit;
$ssender = new SmsSingleSender($appid, $appker);
Copy after login

See if the class is included??

I found the problem last time, which was the case problem. Linux strictly enforces case, while win and mac ignore case, resulting in classes that should be loaded not being loaded.

For more programming-related knowledge, please visit: Programming Learning! !

The above is the detailed content of How to solve the problem that php cannot find the class. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template