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.
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)
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);
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!