Home  >  Q&A  >  body text

linux - 关于thinkphp的import问题

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')“

曾经蜡笔没有小新曾经蜡笔没有小新2737 days ago358

reply all(3)I'll reply

  • 为情所困

    为情所困2017-05-16 13:10:01

    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.

    reply
    0
  • 某草草

    某草草2017-05-16 13:10:01


    Write third-party libraries in

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-05-16 13:10:01

    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.

    reply
    0
  • Cancelreply