亚马逊上Ubuntu服务器上的Rain Framework

时间:2014-11-12 09:40:31

标签: php ubuntu amazon-web-services

我正在尝试在亚马逊上的Ubuntu服务器上为我的移动应用程序API安装Rain框架。它在我的Windows PC上使用XAMPP服务器正常运行,但是当我把它放到主服务器时,这显示以下错误:

  

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

堆栈追踪:

#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

1 个答案:

答案 0 :(得分:2)

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

您可以通过检查运行Web服务器的用户和组(apache,nginx或其他)来执行此操作,然后执行此操作:

$ ps aux | grep apache (or nginx)

然后你想设置用户,组和权限:

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