Page MenuHomePhabricator

Installer warning irrelevant/obsolete for PHP ≥5.4: 'Could not find APC, XCache or WinCache'
Closed, ResolvedPublic

Description

Author: walter

Description:
Installer claims:

"Warning: Could not find APC, XCache or WinCache. Object caching is not enabled."

However, this is php 5.5 and the web suggests that APC-like functionality is apparently pre-integrated.

I would suggest making the installer not mention things that are not relevant ... like wincache on Unix, or any of this muck on php equal to or beyond 5.5.


Version: 1.22.0
Severity: normal

Details

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:42 AM
bzimport set Reference to bz59998.
bzimport added a subscriber: Unknown Object (MLST).

Which MediaWiki version is this about? 1.22.0?

walter wrote:

BTW apparently it's php > 5.4 not php > 5.5 where APC is built in.

  • Zend OPcache doesn't contain an object-level cache. MediaWiki can takes advantage of a cache allowing to store object representations (calling for APC the apc_store function).
  • Nor PHP 5.4, nor PHP 5.5 include APC. But PHP 5.4 introduced a new extension API. Recent versions for APC works at a stable quality on PHP 5.3, but not on PHP 5.4 or PHP 5.5. APC development hasn't been active since 2012.
  • In October 2013, an XCache version with PHP 5.5 support has been released.

I confirm the bug, in the extent we should detect the PHP version and stop to recommend to install APC in 5.4+, as it could only lead system administrators to try to install a broken stable or unstable beta extension on newest PHP versions.

There is an APCu PECL extension offering the APC User Cache code, but not the opcache one.

saper added a subscriber: saper.

This is easy to implement, what exactly shall we say?

This is easy to implement, what exactly shall we say?

@Dereckson: Any ideas / proposals? :-/

Yes, the apcu extension offers the same functions than APC, with apcu_ as prefix.

There are documented at http://php.net/apcu.

I would start at includes/objectcache/ObjectCache.php, to add in getLocalServerInstance a check for apcu_fetch.

Then copy ./includes/libs/objectcache/APCBagOStuff.php to ./includes/libs/objectcache/APCUBagOStuff.php.

If the installer detects it is on 5.5+, it should say "APCu" instead of "APC".

Change 262925 had a related patch set uploaded (by Legoktm):
installer: Say "APCu" for PHP >= 5.5

https://gerrit.wikimedia.org/r/262925

Where available, is opcache autodetected for CACHE_ACCEL/CACHE_ANYTHING purposes, or not?

Where available, is opcache autodetected for CACHE_ACCEL/CACHE_ANYTHING purposes, or not?

No, opcode caching is totally separate from object caching and CACHE_* stuff.

Change 262925 merged by jenkins-bot:
installer: Say "APCu" for PHP >= 5.5

https://gerrit.wikimedia.org/r/262925