TurnKey Linux Virtual Appliance Library

Configuring Xcache

ajblane's picture

I see the Wordpress appliance includes Xcache. That's great, but I'm struggling to get it working.

From what I can gather, I need to enter a username and password in the xcache.ini file (in /etc/php5/conf.d folder), but I'm not sure where to get those details from.

Can anyone point me in the right direction please?

Andrew's picture

Thanks Jeremiah

According to phpinfo, I have 16M available to xcache (so it should be working) but I keep getting server errors when I try to use it for opcode caching within the W3 Total Cache plugin.

Any idea why this might be or any suggestions for diagnosing the problem?

Andrew's picture

I've checked the error log


...and found the following error:
PHP Fatal error:  xcache_clear_cache(): xcache.admin.user and/or xcache.admin.pass settings is not configured. Make sure you've modified the correct php ini file for your php used in webserver. in /var/www/wp-content/plugins/w3-total-cache/lib/W3/Cache/Xcache.php on line 87, referer: http://thoughtspreader.com/wp-admin/admin.php?page=w3tc_general&w3tc_note=config_save
Seems I need to configure the xcache username and password, but I don't know what these are.
If it helps, line 87 of Xcache.php reads: xcache_clear_cache(XC_TYPE_VAR, 0);
Nauseous's picture

Easy way to get an MD5 password

echo -n "password-here" | md5sum


Much easier and safer

Andrew's picture



Thanks for the pointers Jeremiah, I now have xcache working. For others, here's what to do:
  1. Create a temporary file in /var/www called test.php with the following contents:
    <?php echo md5("password"); ?>
  2. Open a browser, navigate to test.php and copy the encrypted password that's displayed
  3. Edit /etc/php5/conf.d/xcache.ini as follows:
    xcache.admin.enable_auth = Off
    xcache.admin.user = "admin" (in my case at least)
    xcache.admin.pass = "abc123" (where "abc123" is the encryped password from step 2)
    xcache.var_size  = 16M (or whatever non-zero value you deem fit)
  4. Restart Apache
  5. Check all is well by browsing to your site and then examining the error.log file at /var/log/apache2

One thing I'm not sure about is how to change the username. I only discovered "admin" worked by trial and error, so I'm sure some extra guidance would be appreciated on that point.

Guest's picture

Thanks Andrew

Thanks Andrew -

I encountered the same xcache problem recently when using Turnkey LAMP for developing a Joomla application. Your final "how I solved" it bit saved me much time trying to figure out what was going on. :)

Andrew's picture

You're welcome Phil

Actually, I'm using APC instead now, but I'm glad my findings helped you.

Andrew's picture

I don't know about Magento

I don't know about Magento but, in WordPress at least, if APC is running on the server, then it should show up as an option in your caching plugin interface (e.g. in W3 Total Cache).

I don't think APC is included in the TKL appliance as standard, so you'd need to manually install it in a terminal session.

I'm not sure exactly how to do that as I've actually moved to an Nginx-based server that I had specially built for me (that includes APC).

If I were you, I'd probably just stick with XCache if it's working OK as, as far as I know, APC isn't significantly better.

But if you're looking to improve performance, moving to Nginx makes a huge difference.

Guest's picture

Thanks Andrew

Hi Andrew,

I'm testing EPESI using a Raspberry Pi and I was facing the same problem.

Only your solution solved my problems.

Thank you.

Nelson Rosado


Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)