Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP Fatal error: Failure in wincache (windows azure)

I have codeigniter framework in my project. My website is running on windows azure platform. Sometimes it's giving me this error:

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

I tried to change php.ini file by changing value of memory:

ini_set('memory_limit','2048M');

But, then after I checked memory_get_peak_usage(); then I found that application is not even using more than 1MB. I don't know what's going on here. I am getting blank page and website gets down when this happens.

Please, ask me if you need more information or code.

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 file is default codeigniter file.

FINAL SOLUTION:

I have updated my php.ini file with this:

wincache.fcenabled=0
wincache.ocenabled=0
wincache.ucenabled=0
wincache.reroute_enabled = 0
wincache.srwlocks = 0
like image 534
Ronak Patel Avatar asked Apr 24 '15 16:04

Ronak Patel


1 Answers

It's an issue with IIS or WinCache on Windows Server. You can follow official thread on a iis forum. Just to be sure, check following options in your php.ini:

wincache.reroute_enabled = 0
wincache.srwlocks = 0

Also update wincache to a latest version.

like image 82
vanadium23 Avatar answered Oct 20 '22 01:10

vanadium23