Hello @dragonsway76
Thank you for reaching out and I am happy to assist you with this
Check the service at the CLI/SSH: memcached-tool 127.0.0.1:11211 display and memcached-tool 127.0.0.1:11211 stats.
telnet 127.0.0.1 11211
should communicate with memcache and respond to status commands etc
Look if the service is running: ps afux | grep memc
restart the service if needed (as root/sudo): service memcached restart.
Thanks!
@vmarko clearly u get this question a lot and didn’t read my post…:-/ But being patient, I followed your suggestions and they all verify that my memcache is installed and working correctly…
your plugin simply is not connecting to memcache..
What next?
Hello @dragonsway76
Thank you for your feedback.
I’ve read your question and all the information you shared.
The message you’re getting from the W3TC means that the W3TC can detect the Memcached extension, however, the Memcached service needs to be restarted or your apache/nginx.
I’ve tested this before answering you and I was able to install the Memcached and get it running and available in the W3TC.
Please check this tutorial, and let me know if it helps!
Thanks!
My apologies for my earlier cynicism… (pre-coffee posts are dangerous :-/ ) ..
In any case.. I did something pretty basic to figure out the problem…
I ran the built in compatibility check.
Plugin Version: 2.2.7
PHP Version: 8.1.12;
Web Server: Not detected
FTP functions: Installed (required for Self-hosted (FTP) CDN support)
Multibyte String support: Installed (required for Rackspace Cloud Files support)
cURL extension: Installed (required for Amazon S3, Amazon CloudFront, Rackspace CloudFiles support)
zlib extension: Installed (required for gzip compression support)
brotli extension: Not detected (required for brotli compression support)
Opcode cache: Installed (OPCache)
Memcached extension: Installed
Memcache extension: Installed
Redis extension: Installed
HTML Tidy extension: Installed (required for HTML Tidy minifier support)
Mime type detection: Installed (Fileinfo) (required for CDN support)
Hash function: Installed (hash) (required for NetDNA / MaxCDN CDN purge support)
Open basedir: Off
zlib output compression: Off
set_time_limit: Available
SSH2 extension: Installed (required for Self-hosted (FTP) CDN SFTP support)
WordPress Resources
/home/user/public_html/wp-content: OK
/home/user/public_html/wp-content/uploads/2022/11: OK
Fancy permalinks: /index.php/%postname%/
WP_CACHE define: Defined (true)
URL rewrite: Disabled
Network mode: Off
I don’t think much of anything will run correctly, if the plugin doesn’t recognize my web server (which does have brotli installed). I am using Virtualmin that bundles that installs a lamp bundle…
How should I proceed.. I have restarted apache2 numerous times without success.
FYI, video not useful.. as stated previously memcached is correctly installed running.. again problem seems to be that the web server is not recognized
Hello @dragonsway76
No worries, I know this can be frustrating sometimes, and honestly, looking at the compatibility check, it’s very interesting that it’s not working, knowing that you followed all the steps.
Just to confirm, are you able to telnet 127.0.0.1 11211 and also to restart the Memcached service?
Opcode cache: Installed (OPCache)
Memcached extension: Installed
Memcache extension: Installed
Redis extension: Installed
The above shows that the PHP extensions are installed. I must mention that the W3TC only recognizes the PHP extensions and this is why Brotli is not detected.
As you also have Redis, have you tried using Redis as a caching method or are you experiencing the same problem there?
Thanks!
This was executed as my user running the wordpress installation.. clearly everything on my end is working.
$ php -m
[PHP Modules]
apcu
bcmath
calendar
Core
ctype
curl
date
dom
exif
FFI
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
igbinary
imagick
imap
intl
json
libxml
mbstring
memcache
memcached
msgpack
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
pspell
readline
Reflection
session
shmop
SimpleXML
soap
sockets
sodium
SPL
sqlite3
ssh2
standard
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
xdebug
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib
[Zend Modules]
Xdebug
Zend OPcache
I haven’t tried Redis, because memcache is suppose to be faster… will give it a quick try in the morning
$ php --ri memcached
memcached
memcached support => enabled
Version => 3.2.0
libmemcached version => 1.0.18
SASL support => yes
Session support => yes
igbinary support => yes
json support => yes
msgpack support => yes
Directive => Local Value => Master Value
memcached.sess_locking => On => On
memcached.sess_lock_wait_min => 150 => 150
memcached.sess_lock_wait_max => 150 => 150
memcached.sess_lock_retries => 5 => 5
memcached.sess_lock_expire => 0 => 0
memcached.sess_binary_protocol => On => On
memcached.sess_consistent_hash => On => On
memcached.sess_consistent_hash_type => ketama => ketama
memcached.sess_number_of_replicas => 0 => 0
memcached.sess_randomize_replica_read => Off => Off
memcached.sess_remove_failed_servers => Off => Off
memcached.sess_server_failure_limit => 0 => 0
memcached.sess_connect_timeout => 0 => 0
memcached.sess_sasl_username => no value => no value
memcached.sess_sasl_password => no value => no value
memcached.sess_persistent => Off => Off
memcached.sess_prefix => memc.sess.key. => memc.sess.key.
memcached.sess_lock_wait => not set => not set
memcached.sess_lock_max_wait => not set => not set
memcached.compression_type => fastlz => fastlz
memcached.compression_factor => 1.3 => 1.3
memcached.compression_threshold => 2000 => 2000
memcached.serializer => php => php
memcached.store_retry_count => 0 => 0
memcached.default_consistent_hash => Off => Off
memcached.default_binary_protocol => Off => Off
memcached.default_connect_timeout => 0 => 0
$ php --ri memcache
memcache
memcache support => enabled
Version => 4.0.5.2
Revision => $Revision$
Directive => Local Value => Master Value
memcache.allow_failover => 1 => 1
memcache.max_failover_attempts => 20 => 20
memcache.default_port => 11211 => 11211
memcache.chunk_size => 32768 => 32768
memcache.protocol => ascii => ascii
memcache.hash_strategy => consistent => consistent
memcache.hash_function => crc32 => crc32
memcache.redundancy => 1 => 1
memcache.session_redundancy => 2 => 2
memcache.compress_threshold => 20000 => 20000
memcache.lock_timeout => 15 => 15
memcache.session_prefix_host_key => Off => Off
memcache.session_prefix_host_key_remove_www => On => On
memcache.session_prefix_host_key_remove_subdomain => Off => Off
memcache.session_prefix_static_key => no value => no value
memcache.session_save_path => no value => no value
memcache.prefix_host_key => Off => Off
memcache.prefix_host_key_remove_www => On => On
memcache.prefix_host_key_remove_subdomain => Off => Off
memcache.prefix_static_key => no value => no value
In any case, I solved the mystery of why the compatibility check said apache2 wasn’t installed.
It was a ModSec Security features that blanks out the name of the server.
Changing this:
/etc/modsecurity/modsecurity.conf:SecServerSignature ” ”
To this:
/etc/modsecurity/modsecurity.conf:SecServerSignature “Apache ”
Solved that mystery.
However, while trying to troubleshoot my original memcached problem…. I discovered this non-sense on my dashboard.
“The required directives for fancy permalinks could not be detected, please confirm they are available:”
I call it non-sense because I immediately opened your compatibility checker…
Which, of course, confirmed that there is no problem with my permalinks:
View post on imgur.com
(not an impressive first time use of your plugin)…
FYI, I just switched from memcached to redis and everything seems to be working fine…..
Question: I setup a redis unix socket which is faster than TCP, how can I use that with your settings?
And, of course, how can I get rid of the permlink garbage on the dashboard?
Hello @dragonsway76
Thank you for your feedback.
This may happen sometimes in some environments. What you can try is to go to Settings > Permalinks > and change Permalinks to plain and save. After that switch back the
Permalink structure to the one you had before and save it again. This should resolve the problem.
W3 Total Cache supports Redis Unix socket. All you need to replace the default hostname with a Redis Unix socket (usually /var/run/redis/redis.sock or /var/run/redis/redis.sock:0)
I hope this helps!
Thanks!