亚马逊Ubuntu服务器上的Rain Framework


Rain Framework on Ubuntu server on Amazon

我正在亚马逊的Ubuntu服务器上为我的移动应用程序API安装Rain框架。它在我的带有XAMPP服务器的Windows PC上运行良好,但当我把它放在主服务器上时,会显示以下错误:

致命错误:未捕获异常"RainTpl_exception",消息为"缓存目录缓存/没有写入权限"。设置写入权限或将RAINTPL_CHECK_TEMPLATE_UPDATE设置为false。有关的更多详细信息http://www.raintpl.com/Documentation/Documentation-for-PHP-developers/Configuration/'in/var/www/html/pidentity/api/system/library/View/rain.tpl.class.php:312

堆栈跟踪:

#0./var/www/html/pidentity/api/system/library/View/rain.tpl.class.php(266): RainTPL->compileFile('content', 'content/', 'app/views/conte...', 'cache/', 'cache/content.9...') 
#1./var/www/html/pidentity/api/system/library/View/rain.tpl.class.php(154): RainTPL->check_template('content/content') 
#2./var/www/html/pidentity/api/system/library/View/Raintpl_View.php(30): RainTPL->draw('content/content', false) 
#3./var/www/html/pidentity/api/system/library/View.php(62): Raintpl_view->draw('content/content', false) 
#4./var/www/html/pidentity/api/app/controllers/content/content.php(15): View->draw('content/content') 
#5.[internal function]: Content_Controller->inde in /var/www/html/pidentity/api/system/library/View/rain.tpl.class.php on line 312

您必须在缓存文件夹中设置正确的写入权限。

您可以通过检查哪个用户和组正在运行您的web服务器(apache、nginx或其他)来做到这一点,为此您可以运行:

$ ps aux | grep apache (or nginx)

然后您要设置用户、组和权限:

$ chown -R [username] ./cache
$ chgrp -R [groupname] ./cache
$ chmod -R 755 ./cache