doutanghuan9595 2014-04-17 16:39
浏览 23
已采纳

Restler 3.0 RC5 HtmlFormat使用mkdir

first thanks for your brilliant work on Restler, I am using it for some labs at the University and so far it works like a charm, really simple and elegant framework!

I've been using Restler 3.0 RC4 successfully until I updated to RC5 today. Now I'm having problems with the HtmlFormat. Whenever I try to access any of my web services that return HtmlFormat or try to enter the API Explorer, I'm getting a HTTP 500, "Unable to create cache directory /home/xxxxxxx/public_html/concrete/api/cache/php" . Also, I see a "Warning: mkdir() [function.mkdir]: No such file or directory in /home/xxxxxxx/public_html/concrete/Restler/vendor/Luracast/Restler/Format/HtmlFormat.php on line 367" .

Do you have any idea of what could be happening? In the upgrade, I just replaced my Restler framework folder with the RC5 one, without any changes in my API itself.

I would appreciate any help. Thank you!

  • 写回答

1条回答 默认 最新

  • drevls8138 2014-04-18 07:28
    关注

    Most of the template formats need a cache folder to keep their compiled files so that they run efficiently

    Since RC5 we create a subfolder for the template type used. Even though php templates does not need compilation Restler attempts creating php folder under the default cache location, which is cache folder located in the same folder as the index.php

    In your case it is

    /home/xxxxxxx/public_html/concrete/api/cache
    

    You should update the cache folder to keep it outside the web root by adding

    Defaults::$cacheDirectory = '/home/xxxxxxx/cache';
    

    And then make sure the cache folder is writable

    Then HtmlFormat will create the php/twig/blade folder depending on your template preference and add the compiled files inside

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 为什么apriori的运行时间会比fp growth的运行时间短呢
  • ¥15 帮我解决一下膳食平衡的线性规划模型的数据实例
  • ¥40 万年历缺少农历,需要和阳历同时显示
  • ¥250 雷电模拟器内存穿透、寻基址和特征码的教学
  • ¥200 比特币ord程序wallet_constructor.rs文件支持一次性铸造1000个代币,并将它们分配到40个UTXO上(每个UTXO上分配25个代币),并设置找零地址
  • ¥15 关于Java的学习问题
  • ¥15 如何使用chatgpt完成文本分类任务?
  • ¥15 已知速度v关于位置s的等式,怎么转化为已知位置求速度v的等式
  • ¥15 我有个餐饮系统,用wampserver把环境配置好了,但是后端的网页却进去,是为什么,能不能帮远程一下?
  • ¥15 R运行没有名称为"species"的插槽对于此对象类"SDMmodelCV"