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

Reference
bz59998

Event Timeline

bzimport raised the priority of this task from to Normal.
bzimport set Reference to bz59998.
bzimport added a subscriber: Unknown Object (MLST).
bzimport created this task.Jan 13 2014, 2:16 PM

Which MediaWiki version is this about? 1.22.0?

walter wrote:

Yes 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.
Dereckson added a comment.EditedJan 19 2014, 1:03 AM

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.

Paladox set Security to None.May 23 2015, 5:39 PM
Paladox added a subscriber: Aklapper.

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.

Dereckson added a comment.EditedDec 12 2015, 9:03 PM

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.

Legoktm added a subscriber: Legoktm.Jan 7 2016, 8:43 PM

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

Legoktm claimed this task.Jan 7 2016, 9:11 PM

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

Legoktm closed this task as Resolved.Jan 26 2016, 2:28 AM
Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptJul 11 2016, 1:51 AM
Danny_B moved this task from Unsorted to PHP 5.4 on the [DO NOT USE] NewPHP board.Jul 11 2016, 1:54 AM