【问题标题】:Unable to write cache folder for smarty project on pagodabox无法在 pagodabox 上为 smarty 项目写入缓存文件夹
【发布时间】:2012-11-25 07:08:00
【问题描述】:

我已经在 smarty 中创建了项目,现在我正在尝试将它托管在 pagodabox.com 上。我已经在 pagodabox.com 上创建了应用程序并将所有代码上传到此应用程序,但问题是现在我无法在 pagodabox.com 中配置缓存和编译器目录,这就是它输出胎儿错误的原因,因为缓存和编译器目录是只读模式。我尝试使用 Boxfile 解决此问题,但未能解决。我不知道如何使这些目录可写。请帮我。这是项目 http://moviestock.pagodabox.com/ 的 url,以下是我的 Boxfile 配置

web1: #component type & number
  name: blog            #component settings
  shared_writable_dirs:
    - var/secured/cache
    - var/secured/compiler
    - var/sessions
  document_root: app
  php_version: 5.3.8

我收到以下错误:

Fatal error: Uncaught exception 'SmartyException' with message 'unable to write file   
shared/secured/compiler/wrt50c17dfaca2932.90478039' in 
/var/www/libs/sysplugins/smarty_internal_write_file.php:44 Stack trace: #0 
/var/www/libs/sysplugins/smarty_internal_template.php(201): 
Smarty_Internal_Write_File::writeFile('shared/secured/...', 'compileTemplateSource() #2  
/var/www/libs/sysplugins/smarty_internal_templatebase.php(374): 
Smarty_Internal_TemplateBase->fetch('extends:layout....', '6666cd76f969564...', NULL, 
NULL, true) #3 /var/www/classes/BaseController.php(22): Smarty_Internal_TemplateBase-
>display('extends:layout....', '6666cd76f969564...') #4 
/var/www/secured/controllers/HomeController.php(6): BaseController->render('home') #5 
[internal function]: HomeController->indexAction('') #6 
/var/www/classes/Router.php(26): call_user_func_array(Array, Array) #7 
/var/www/index.php(10): Router::run() #8 in 
/var/www/libs/sysplugins/smarty_internal_write_file.php on line 44 

【问题讨论】:

  • 已确定您的脚本对这些(子)文件夹具有写入权限?这可能是唯一的问题。
  • 是的,我知道,但是我怎样才能在 pagodabox 服务器上启用写入文件夹的权限
  • 很抱歉,但我不知道。

标签: php smarty3 server-configuration


【解决方案1】:

不确定,但也许@chmod(PATH,0770); 会成功?

【讨论】:

  • 好吧,我想在PHP文件中使用它
  • 不,对不起,亲爱的,这不适用于 pagodabox 我认为共享目录可以由 Boxfile 创建,但不知道我在做什么错
【解决方案2】:

我认为这与 smarty 试图写入的文件路径有关。在错误中,文件路径是shared/secured/compiler/wrt50c17dfaca2932.90478039。应该是var/secured/compiler/wrt50c17dfaca2932.90478039

【讨论】:

  • 现在请看它的说法 Not Found The requested URL / was not found on this server.
猜你喜欢
  • 1970-01-01
  • 2014-08-03
  • 1970-01-01
  • 2014-07-28
  • 1970-01-01
  • 1970-01-01
  • 2012-08-24
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多