Page MenuHomePhabricator

web configuration does not properly detect apcu
Closed, ResolvedPublic

Description

I am installing 1.27.0 on webtatic's php 7.0 on centos 6.x -- I have the apcu extension installed, and it is displayed when I phpinfo()

apcu
APCu Support Enabled
Version 5.1.3
APCu Debugging Disabled
MMAP Support Disabled
Serialization Support php
Build Date Jan 16 2016 13:22:48

The web configuration tool is saying:

PHP 7.0.6 is installed.
Warning: Could not find APCu, XCache or WinCache.
Object caching is not enabled.

I know that there is a APCu-bc package, however I do not have it installed, since webtatic does not provide it yet. While I do not know if this is why it fails to detect, I imagine it could be.

Could the error message be improved to mention if APCu-bc is also required? Right now it is very confusing as it asks for APCu and I have it installed. Or if the detection is simply not working properly, then that could also be fixed.

Thanks

Details

Related Gerrit Patches:
mediawiki/core : mastertests: fix PHPUnit @requires for APCU
mediawiki/core : masterDetect/use APCu properly
mediawiki/core : REL1_27Detect/use APCu properly
mediawiki/core : wmf/1.28.0-wmf.20Detect/use APCu properly

Event Timeline

Restricted Application added subscribers: Zppix, Aklapper. · View Herald TranscriptJul 17 2016, 11:29 PM
Reedy added a subscriber: Reedy.
	/**
	 * Known object cache types and the functions used to test for their existence.
	 *
	 * @var array
	 */
	protected $objectCaches = [
		'xcache' => 'xcache_get',
		'apc' => 'apc_fetch',
		'wincache' => 'wincache_ucache_get'
	];

	/**
	 * Environment check for compiled object cache types.
	 */
	protected function envCheckCache() {
		$caches = [];
		foreach ( $this->objectCaches as $name => $function ) {
			if ( function_exists( $function ) ) {
				if ( $name == 'xcache' && !wfIniGetBool( 'xcache.var_size' ) ) {
					continue;
				}
				$caches[$name] = true;
			}
		}

		if ( !$caches ) {
			$key = 'config-no-cache-apcu';
			$this->showMessage( $key );
		}

		$this->setVar( '_Caches', $caches );
	}

This vaguely means that MW can't find the apc_fetch function in the config that the installer is being run

Reedy added a comment.EditedJul 17 2016, 11:35 PM

And it's apcu_fetch in apcu...

So this feels like a documentation/message mismatch to begin with.

And to support using it, the installer needs apcu_fetch adding to $objectCaches, and an APCBagOStuff variant creating for apcu...

FWIW, Ubuntu doesn't seem to package apcu-bc, but it's available via PECL. Not sure this is something we should be making users install for a back compat layer

Restricted Application added a project: Documentation. · View Herald TranscriptJul 17 2016, 11:39 PM
Reedy moved this task from Unsorted to PHP 7 on the [DO NOT USE] NewPHP board.

Change 299498 had a related patch set uploaded (by Reedy):
Detect/use APCu properly

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

Reedy moved this task from PHP 7 to PHP 5.5 on the [DO NOT USE] NewPHP board.Jul 17 2016, 11:48 PM
Reedy added a comment.Aug 6 2016, 10:58 PM

Another user complaining about this on IRC today

Change 299498 merged by jenkins-bot:
Detect/use APCu properly

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

Change 313756 had a related patch set uploaded (by Reedy):
Detect/use APCu properly

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

Paladox added a subscriber: Paladox.Oct 2 2016, 2:10 PM

Change 313836 had a related patch set uploaded (by Paladox):
Detect/use APCu properly

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

Change 313836 abandoned by Paladox:
Detect/use APCu properly

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

Change 313756 merged by jenkins-bot:
Detect/use APCu properly

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

Reedy closed this task as Resolved.Oct 4 2016, 11:28 PM
Reedy claimed this task.

Change 423650 had a related patch set uploaded (by Hashar; owner: Hashar):
[mediawiki/core@master] tests: fix PHPUnit @requires for APCU

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

Change 423650 merged by jenkins-bot:
[mediawiki/core@master] tests: fix PHPUnit @requires for APCU

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