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?
Replies (10)
I've checked the error log
Reply 1Sorry, but no I don't have any other ideas offhand
Reply 2Sorry, but no I don't have any other ideas offhand. Do the errors point to anything in particular?
Thanks Jeremiah
Reply 3According 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?
It should be working automatically
Reply 4XCache should already be working. Look for an XCache section in phpinfo to see if it is. As long as xcache.size is not set to zero in /etc/php5/conf.d/xcache.ini then it should be working.
The username and password are used for "administration" but that administration is not actually required for xcache to work. If you do want to install the administration part of xcache you can follow the instructions found here.
Easy way to get an MD5 password
Reply 5echo -n "password-here" | md5sum
Much easier and safer
It sounds like the wordpress
Reply 6It sounds like the wordpress plugin calls the xcache_clear_cache() function which is requiring the xcache admin username and password to be set. Follow the instructions in section 1.2 Generating your auth password. Basically you just need to encrypt your password and then put the username and password either in the /etc/php5/conf.d/xcache.ini or your php.ini file and restart apache. I'm not sure but you may need to enter the username and password somewhere in the w3-total-cache plugin interface as well.
To encrypt your password you can create a temporary file on your webserver called test.php with the following contents.
<?php echo md5("password"); ?>
Then from your webserver's command line just run the following command and you should see the encrypted form of your password which you'll put in either of the .ini files mentioned above.
php test.php
Solved!
Reply 7
- Create a temporary file in /var/www called test.php with the following contents:
<?php echo md5("password"); ?> - Open a browser, navigate to test.php and copy the encrypted password that's displayed
- Edit /etc/php5/conf.d/xcache.ini as follows:xcache.admin.enable_auth = Offxcache.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)
- Restart Apache
- 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.
You're welcome Phil
Reply 8Actually, I'm using APC instead now, but I'm glad my findings helped you.
How to Swap to APC? How to tell what is running.
Reply 9A while back I tried switching Magento to APC from XCache but was not able to get it done.. There are some postings a while back on the subject.
What is the basic process from going from one to the other?
Are there any constraints in TKL that complicate this?
I don't know about Magento
Reply 10I 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.