Problem

Wincache is a required dependency which requires an unsupported version of PHP, 5.5 or less.

Context/Commentary

Typically what I've seen is a caching dependency is a recommendation rather than a requirement.

When upgrading sqlsrv module I see there is now a dependency on wincache. When attempting to install the wincache PHP module I first had to downgrade PHP to 5.5 since wincache isn't supported in 5.6. Then, I discovered wincache is compiled not thread safe, whereas my PHP version is thread safe, so the module wouldn't install, see error:

[03-Nov-2016 20:14:55 UTC] PHP Warning: PHP Startup: wincache: Unable to initialize module
Module compiled with build ID=API20121212,NTS,VC11
PHP compiled with build ID=API20121212,TS,VC11
These options need to match

I didn't want to take the time to recompile the module or PHP, so my solution for now will be to not upgrade the sqlsrv module.

It is important to note that the dependency on wincache prevents anyone using sqlsrv from upgrading to a supported PHP version. Wincache only works with 5.5 or older, and 5.5 is end of life: http://php.net/supported-versions.php.

Also to note, my understanding is that wincache would not be needed with PHP 5.5 or later since opcache is included http://php.net/manual/en/opcache.installation.php, a further incentive to make wincache an optional dependency.

Proposed Solution

Make wincache an optional dependency.

Comments

josephdpurcell created an issue. See original summary.

josephdpurcell’s picture

Issue summary: View changes
david_garcia’s picture

Category: Feature request » Support request
Priority: Major » Normal
Status: Active » Closed (won't fix)

I encourage you to investigate better the current support status of the wincache extension, that does not match at all what you have explained here.

BTW on the 8.2.x I made the cache both wincache and apc compatible. And kt will fallback to nothing if none of them is available. Unfortunately I won't be backporting that change.

josephdpurcell’s picture

Sorry, I should have referenced what I saw. This article suggests WinCache is only supported up to PHP 5.5 https://www.iis.net/downloads/microsoft/wincache-extension

Is WinCache available in 5.6?

Joe.U.Questionmark’s picture

@david_garcia

1. Would it be possible for us to stub out the wincache_ucache_get() and wincache_ucache_set() methods to just return null in the 7.x version to make it work without wincache?

2. Would you accept a pull request to abstract the caching implementation in the 7.x version so wincache could be replaced or caching could be disabled? How much work would this require?

Thanks for your time.

david_garcia’s picture

We could easily detect if they are not defined and in that case stub them (or maybe have an in-memory implementation that lasts for a single request). I would be accepting a patch that does that.

david_garcia’s picture

Status: Closed (won't fix) » Fixed

Removed dependency on Wincache for the driver in the latest dev. The query cache was not worth after moving to PHP7.

Other internal caches still use Wincache through the fastcache class, but fastcache will work even if Winache is not enabled (when wincache not enabled it will simply work as in in-memory storage for the current request).

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.