Topic on Project:Support desk

[RESOLVED] "CACHE_ACCEL requested but no suitable object cache is present."

10
Dlwnsgud0819 (talkcontribs)

[4bcac667] [no req] Exception from line 141 of /home/xxxwiki/user/w/includes/objectcache/ObjectCache.php: CACHE_ACCEL requested but no suitable object cache is present. You may want to install APC. Backtrace:
#0 [internal function]: ObjectCache::newAccelerator(array)
#1 /home/xxxwiki/user/w/includes/objectcache/ObjectCache.php(85): call_user_func(string, array)
#2 /home/xxxwiki/user/w/includes/objectcache/ObjectCache.php(72): ObjectCache::newFromParams(array)
#3 /home/xxxwiki/user/w/includes/objectcache/ObjectCache.php(44): ObjectCache::newFromId(integer)
#4 /home/xxxwiki/user/w/includes/GlobalFunctions.php(3952): ObjectCache::getInstance(integer)
#5 /home/xxxwiki/user/w/includes/Setup.php(561): wfGetMainCache()
#6 /home/xxxwiki/user/w/maintenance/doMaintenance.php(97): require_once(string)
#7 /home/xxxwiki/user/w/maintenance/edit.php(103): require_once(string)
#8 {main}

I installed APC, and it appears in phpinfo, but when I used edit.php, the error occurs.

Version is like this:

MediaWiki : 1.24.2

PHP : 5.4.39 (apache)

MySQL : 5.0.45-log

APC : 3.1.13

Florianschmidtwelzow (talkcontribs)

Maybe your command line php version isn't the one you use for your webserver? Can you check, from your command line, if APC is installed? Does your wiki work from a webbrowser?

Dlwnsgud0819 (talkcontribs)

First, I use now wiki on Web Hosting.

1. It works very well on web browser.

2. When I command 'php -m', There is no apc. The manager of web hosting says "I don't know why doesn't appear in user rights' command, But there is apc when do command by root."

EDIT: First now I set CACHE_ANYTHING to use edit.php. It works well in CACHE_ANYTHING.

Florianschmidtwelzow (talkcontribs)

If your wiki works with the webbrowser and not from the command line, then the command line uses another php.ini (this is definitely so), or you're using another (old) version of php from your command line.

Check your php.ini for your command line (usually /etc/php5/cli/php.ini on Ubunutu) and check, if apc is enabled there, too. But for this your hosting provider should really support you, "i don't know" doesn't sound like a good answer ;)

Dlwnsgud0819 (talkcontribs)

Thank you for your answer.

He acknowledged his mistakes.

Florianschmidtwelzow (talkcontribs)

So, the problem was? :)

Dlwnsgud0819 (talkcontribs)

He said "The problem in command php is permisson. For prevent to be seen php.ini in shell by users, I set 600 permission. So this cause that error."

Problem is resolved.

83.134.207.130 (talkcontribs)

Hello, I 'm not an IT-expert but have had some years of experience with php and mysql. Nowadays I 'm not up to date with current developments but was forced to upgrade my wiki (that I installed in 2009) due to an upgrade of PHP on the server on which I hosted the wiki.

The version of Mediawiki I 'm trying to install is 1.24.2, the php-version on the server is 5.6, the software on the server is MariaDB version 5.5.43, the server is Apache/2.2.16 (Debian)...

I get a similar error as posted above. I tried to run the update.php script from a SSH shell (PuTTY) and from the web browser. Both with the same result. I 've contacted the online support of the host but they say they don't support APC (due to security issues) and that i should contact Mediawiki to ask if a manual update is possible. Is there a way around for this? Is it a possibility to upgrade the wiki offline and upload it then to the server or might this still give the same problem? Is APC necessary for the operationallity of an installed wiki? If so, I 'll probably have to move the wiki to another host, right?

Can you help me because i m really at the end of my possibilities here :-/

TheDJ (talkcontribs)

Please read: Manual:Cache:

> If you have a PHP object cache such as APC(u) or XCache, you can easily use this to store all of the extra data.
> This is strongly recommended, and requires the following line in LocalSettings.php:
> $wgMainCacheType = CACHE_ACCEL;
> If you are unable to use such a cache, then you may be able to use memcached, see that page for details.
> This is considerably more complicated, but still very effective.
> Note that you should not use CACHE_ACCEL or memcached in shared hosting as these caches are shared between vhosts.
> The other two types of object cache use a database for caching. This may (or may not) be better than nothing,
> but one of the previous two solutions should be tried first.
> $wgMainCacheType = CACHE_DB;

So either you can host your own private memcached/redis instance on your hosting account, or use database caching.

83.134.207.130 (talkcontribs)

Thanks! That was very helpfull. I 've informed with the host and found out that Object cashing is not enabled/supported. So nor APC, XCache, WinCache or MemCached was a possibility. Thus, I 've had to change $wgMainCacheType = CACHE_DB; in the LocalSettings.php to be able to perform the update. The only thing I 'm wondering about now, is whether this affects the performance of the wiki. I didn't set any other valuables like $wgCacheDirectory in the LocalSettings.php file. Is this the best way to increase performance?