thinkphp用import导入一个插件的类,然后用+类名实例化,这样在本地上是可行的,但是在服务器上就不行了。执行方法在admin模块里的控制器,调用Common模块的常用方法functions.php里面的test方法,test方法import类,然后实例化,结果not found,test方法里改为用require引入require_once('../Extensions/...'),路径是对的,结果提示:”require(): Failed opening required '../Extensions/PHPThumb/phpthumb.class.php' (include_path='.:/usr/local/php/lib/php')“
The development environment is Windows and the online environment is Linux, right?
1 Pay attention to capitalization
2 Try both absolute paths and relative paths.
Write third-party libraries in
In the end, I used absolute paths to solve the problem. I really didn’t want to do this. I hope people with similar experience can leave their answers.