向Linux系统下移植TP框架遇到的问题

1、这是一个将windows下运行正常的ThinkPHP框架移到Linux下会出现的一个问题:
:(
_STORAGE_WRITEERROR:./Runtime/Cache/Install/c6bbce5b1f1dcf027c8ceb5cf5141b65.php
错误位置
FILE: /home/wwwroot/testisale/ThinkPHP/Library/Think/Storage/Driver/File.class.php  LINE: 48
TRACE
/#0 /home/wwwroot/testisale/ThinkPHP/Library/Think/Storage/Driver/File.class.php(48): E(‘_STORAGEWRITE…’)
/#1 [internal function]: Think\Storage\Driver\File->put(‘./Runtime/Cache…’, ‘ #2 /home/wwwroot/testisale/ThinkPHP/Library/Think/Storage.class.php(37): call_user_func_array(Array, Array)
/#3 /home/wwwroot/testisale/ThinkPHP/Library/Think/Template.class.php(114): Think\Storage::__callstatic(‘put’, Array)
/#4 /home/wwwroot/testisale/ThinkPHP/Library/Think/Template.class.php(114): Think\Storage::put(‘./Runtime/Cache…’, ‘ #5 /home/wwwroot/testisale/ThinkPHP/Library/Think/Template.class.php(76): Think\Template->loadTemplate(‘./Application/I…’, ‘’)
/#6 /home/wwwroot/testisale/ThinkPHP/Library/Behavior/ParseTemplateBehavior.class.php(32): Think\Template->fetch(‘./Application/I…’, Array, ‘’)
/#7 /home/wwwroot/testisale/ThinkPHP/Library/Think/Hook.class.php(119): Behavior\ParseTemplateBehavior->run(Array)
/#8 /home/wwwroot/testisale/ThinkPHP/Library/Think/Hook.class.php(89): Think\Hook::exec(‘Behavior\ParseT…’, ‘view_parse’, Array)
/#9 /home/wwwroot/testisale/ThinkPHP/Library/Think/View.class.php(126): Think\Hook::listen(‘view_parse’, Array)
/#10 /home/wwwroot/testisale/ThinkPHP/Library/Think/View.class.php(72): Think\View->fetch(‘’, ‘’, ‘’)
/#11 /home/wwwroot/testisale/ThinkPHP/Library/Think/Controller.class.php(56): Think\View->display(‘’, ‘’, ‘’, ‘’, ‘’)
/#12 /home/wwwroot/testisale/Application/Install/Controller/IndexController.class.php(27): Think\Controller->display()
/#13 [internal function]: Install\Controller\IndexController->index()
/#14 /home/wwwroot/testisale/ThinkPHP/Library/Think/App.class.php(173): ReflectionMethod->invoke(Object(Install\Controller\IndexController))
/#15 /home/wwwroot/testisale/ThinkPHP/Library/Think/App.class.php(110): Think\App::invokeAction(Object(Install\Controller\IndexController), ‘index’)
/#16 /home/wwwroot/testisale/ThinkPHP/Library/Think/App.class.php(204): Think\App::exec()
/#17 /home/wwwroot/testisale/ThinkPHP/Library/Think/Think.class.php(120): Think\App::run()
/#18 /home/wwwroot/testisale/ThinkPHP/ThinkPHP.php(97): Think\Think::start()
/#19 /home/wwwroot/testisale/install.php(35): require(‘/home/wwwroot/t…’)
/#20 {main}
ThinkPHP3.2.3 { Fast & Simple OOP PHP Framework } – [ WE CAN DO IT JUST THINK ]

出现这个问题的原因是项目中的Runtime权限不够,需要给Runtime和其目录下的所有文件授权,读者只需要执行下列命令即可:

chmod -R 777 Runtime



2、这个问题的原因是开发者在window下开发时没有良好的习惯造成的

windows下TP可以不分大小写,尤其是文件命名和function之间大小写的差别被忽略。

如果开发者仅仅是在windows下就不会出现任何问题,但是如果开发完成后将project移动到Linux下就悲剧了,因为Linux是严格大小写区分的。

虽然原因很简单,但不幸的是,你必须一个个去把大小写统一。我在曾经与人开发的项目中大家没有重视大小写统一的问题,导致今天我把以前的所有项目进行整理发布到自己的CentOS服务器上时很多错误报出。

希望这篇博客对读者有用。