我的项目中有 codeigniter 框架。我的网站运行在windows azure平台上。有时它会给我这个错误:
PHP Fatal error: Failure in Wincache[6484] free_memory: Block 0x41d56d8 not in use in D:\home\site\wwwroot\system\libraries\Log.php on line 44
我尝试通过更改内存值来更改 php.ini 文件:
ini_set('memory_limit','2048M');
但是,在我检查 memory_get_peak_usage();
之后,我发现应用程序使用的甚至不超过 1MB
。我不知道这里发生了什么事。发生这种情况时,我会收到空白页面,并且网站会崩溃。
如果您需要更多信息或代码,请询问我。
Log.php:
public function __construct()
{
$config =& get_config();
$this->_log_path = ($config['log_path'] != '') ? $config['log_path'] : APPPATH.'logs/';
if ( ! is_dir($this->_log_path) OR ! is_really_writable($this->_log_path)) // This is line 44.
{
$this->_enabled = FALSE;
}
if (is_numeric($config['log_threshold']))
{
$this->_threshold = $config['log_threshold'];
}
if ($config['log_date_format'] != '')
{
$this->_date_fmt = $config['log_date_format'];
}
}
log.php 文件是默认的 codeigniter 文件。
最终解决方案:
我已经用以下内容更新了我的 php.ini
文件:
wincache.fcenabled=0
wincache.ocenabled=0
wincache.ucenabled=0
wincache.reroute_enabled = 0
wincache.srwlocks = 0
最佳答案
这是 Windows Server 上的 IIS 或 WinCache 的问题。您可以关注official thread在iis论坛上。 为了确定起见,请检查 php.ini 中的以下选项:
wincache.reroute_enabled = 0
wincache.srwlocks = 0
还将 wincache 更新到最新版本。
关于PHP fatal error : Failure in wincache (windows azure),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29852844/