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

Event Timeline

Reedy subscribed.
	/**
	 * 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

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

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

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

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

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 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