How to clear xcache from php or capistrano or shell command?

4,588 views
Skip to first unread message

RR

unread,
Apr 9, 2014, 6:39:56 AM4/9/14
to xca...@googlegroups.com
  

    Hi All,

   

I am deploying my code using webistrano. A new release is created as well as the doc root symlink works fine, but when I try to access my website on browser , still the old code is referenced. This issue is because somehow xcache is not updating its cache. When I manually touch all the files of the code , then it works fine.

I found that if I manually clean xcache from xcache-admin then it start working fine, but is there any way that I can clear xcache in one-go from php file or shell command.



Thanks!!

Keith Davis

unread,
Apr 9, 2014, 7:12:35 AM4/9/14
to xca...@googlegroups.com
You can do it from PHP:


void   xcache_clear_cache(int type [, int id = -1])

Reshu Rajput

unread,
Apr 11, 2014, 12:58:25 AM4/11/14
to xca...@googlegroups.com
But that need to have authentication first, is there any API which could authenticate the user as well to call xcache_clear_cache().


--

---
You received this message because you are subscribed to a topic in the Google Groups "XCache" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/xcache/IBFCdotR5H0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to xcache+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Regards,
 
Reshu Rajput

Keith Davis

unread,
Apr 12, 2014, 7:19:48 AM4/12/14
to xca...@googlegroups.com
I'm not sure what you mean. Are you referring to your website's authentication?


On Wednesday, April 9, 2014 5:39:56 AM UTC-5, RR wrote:

Alex Salvatore

unread,
Apr 20, 2014, 7:38:13 AM4/20/14
to xca...@googlegroups.com
This is an admin command, if you don't have admin set in php.ini it won't work:

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

I have the same problem, the php.ini I have from my provider states:
xcache.admin.enable_auth="on"
xcache.admin.pass=""
xcache.admin.user="mOo"

I can't edit this php.ini, and neither I can use per-directory INI files or .htaccess, and of course the provider is not going to give the XCache admin password. ;)

A possible solution could be to have this in the PHP script itself:
ini_set("xcache.cacher",0);
ini_set("xcache.optimizer","Off");

But it doesn't seem to work, which makes sense as XCache keeps using the cached version and doesn't get to these commands.

Any other options?

Keith Davis

unread,
Apr 21, 2014, 8:20:49 AM4/21/14
to xca...@googlegroups.com
I'm shocked you found a shared hosting provider that allows the XCache extension. :)

The XCache admin username and password should be per virtual host, not per server - have you contacted your provider and asked?

I don't have any other ideas - move to a dedicated server? Digital Ocean is cheap or even something like WebFaction. HawkHost is shared hosting, but they provide SSH and might allow this type of management.

Not good answers, but the only ones I got.


On Wednesday, April 9, 2014 5:39:56 AM UTC-5, RR wrote:
Reply all
Reply to author
Forward
0 new messages