douran7929 2010-07-25 15:08 采纳率: 100%
浏览 174
已采纳

Symfony-Cache文件夹中的临时文件

I'm using Windows on some production machines (IIS with FastCGI-PHP). Since the update of one SF-Project to 1.3.x I notice some strange problems. The Server is "collecting" Temp-Files in the config-cache folder of the applications. They are named like con1718.tmp and always containing the autoload-config-cache. The tmp-files are not generated for every request but I have 1 or 2 new files every half an hour or so. If the application is running some days/months there are a lot of these Temp-Files (Megabytes of them).

Machine-Details: - Windows Server 2008 - IIS 7 - ZendServer? with PHP 5.2.11

Project with SF 1.3.3

Any ideas what the problem can be?

  • 写回答

3条回答 默认 最新

  • doucheng2210 2010-08-21 12:03
    关注

    I checked out symfony 1.4 and saw this in the code:

         // Hack from Agavi (http://trac.agavi.org/changeset/3979)
         // With php < 5.2.6 on win32, renaming to an already existing file doesn't work, but copy does,
         // so we simply assume that when rename() fails that we are on win32 and try to use copy()
         if (!@rename($tmpFile, $cache))
         {
           if (copy($tmpFile, $cache))
           {
             unlink($tmpFile);
           }
    
         }
    

    This piece of code should be in sfConfigCache.php on line 354, could you check you have this lines? If not, consider updating, or patching, and if yes, you could log $tmpFile before unlinking it, just to see if there is an attempt to unlink these files or not. To add more information log, you should try this code instead:

     if (!@rename($tmpFile, $cache))
     {
       sfContext::getInstance()->getLogger()->info('attempt to renaming ' . $tmpFile . ' failed, trying copy');
       if (copy($tmpFile, $cache))
       {
         sfContext::getInstance()->getLogger()->info('copy successful, now unlinking ' . $tmpFile);
         unlink($tmpFile);
       }
       else
       {
         sfContext::getInstance()->getLogger()->err('probem with copy for file '.$tmpFile);
       }
    
     }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥20 RL+GNN解决人员排班问题时梯度消失
  • ¥15 统计大规模图中的完全子图问题
  • ¥15 使用LM2596制作降压电路,一个能运行,一个不能
  • ¥60 要数控稳压电源测试数据
  • ¥15 能帮我写下这个编程吗
  • ¥15 ikuai客户端l2tp协议链接报终止15信号和无法将p.p.p6转换为我的l2tp线路
  • ¥15 phython读取excel表格报错 ^7个 SyntaxError: invalid syntax 语句报错
  • ¥20 @microsoft/fetch-event-source 流式响应问题
  • ¥15 ogg dd trandata 报错
  • ¥15 高缺失率数据如何选择填充方式