{"id":627,"date":"2023-04-14T09:52:32","date_gmt":"2023-04-14T13:52:32","guid":{"rendered":"https:\/\/www.amixa.com\/blog\/?p=627"},"modified":"2023-04-14T10:27:47","modified_gmt":"2023-04-14T14:27:47","slug":"wordpress-php-and-iis-setup-of-redis-using-redis-object-cache-free-plugin","status":"publish","type":"post","link":"https:\/\/www.amixa.com\/blog\/2023\/04\/14\/wordpress-php-and-iis-setup-of-redis-using-redis-object-cache-free-plugin\/","title":{"rendered":"WordPress, PHP and IIS setup of REDIS using Redis Object Cache Free Plugin"},"content":{"rendered":"<p><em><strong>Note:\u00a0 This presumes you already have a working REDIS server inside your LAN.\u00a0 If you don&#8217;t, please see my coming post on how to set up a REDIS virtual machine on HYPER-V.<\/strong><\/em><\/p>\n<p>&nbsp;<\/p>\n<ol>\n<li>You will need to install the php REDIS extension.\u00a0 I am using IIS 10 and Windows Server 2022, so I went to this page: <a href=\"https:\/\/pecl.php.net\/package\/redis\">https:\/\/pecl.php.net\/package\/redis<\/a> and downloaded 5.3.7 stable (as of 04-2023).<\/li>\n<li>Extract<\/li>\n<li>I am on the latest 7.4x build of PHP which is 7.4.33 as of 04-2023.\u00a0 This will supposedly work fine under 8.x but I haven&#8217;t tested it inside my environment.<\/li>\n<li>copy the files pictured below to your PHP EXT folder.\n<ol>\n<li><a href=\"http:\/\/www.amixa.com\/blog\/wp-content\/uploads\/2023\/04\/2023-04-14_09-42-04.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-628 size-large\" src=\"http:\/\/www.amixa.com\/blog\/wp-content\/uploads\/2023\/04\/2023-04-14_09-42-04-1024x201.jpg\" alt=\"\" width=\"860\" height=\"169\" srcset=\"https:\/\/www.amixa.com\/blog\/wp-content\/uploads\/2023\/04\/2023-04-14_09-42-04-1024x201.jpg 1024w, https:\/\/www.amixa.com\/blog\/wp-content\/uploads\/2023\/04\/2023-04-14_09-42-04-300x59.jpg 300w, https:\/\/www.amixa.com\/blog\/wp-content\/uploads\/2023\/04\/2023-04-14_09-42-04-768x151.jpg 768w, https:\/\/www.amixa.com\/blog\/wp-content\/uploads\/2023\/04\/2023-04-14_09-42-04.jpg 1034w\" sizes=\"auto, (max-width: 860px) 100vw, 860px\" \/><\/a><\/li>\n<\/ol>\n<\/li>\n<li>Add REDIS information into your wp-config.php file\n<ol>\n<li>edit the file<\/li>\n<li>near the top of the file, add the following<\/li>\n<li>\n<pre>\/\/ adjust Redis host and port if necessary\u00a0\r\ndefine( 'WP_REDIS_HOST', 'x.x.x.x' );\r\ndefine( 'WP_REDIS_PORT', 6379 );\r\n\r\n\/\/ change the prefix and database for each site to avoid cache data collisions\r\ndefine( 'WP_REDIS_PREFIX', 'name-of-your-site' );\r\ndefine( 'WP_REDIS_DATABASE', 0 ); \/\/ 0-15\r\n\r\n\/\/ reasonable connection and read+write timeouts\r\ndefine( 'WP_REDIS_TIMEOUT', 1 );\r\ndefine( 'WP_REDIS_READ_TIMEOUT', 1 );\r\ndefine( 'WP_REDIS_SCHEME', 'tcp' );<\/pre>\n<\/li>\n<li>CHANGE the HOST IP to the LAN IP of your REDIS server<\/li>\n<li>CHANGE the PREFIX to a unique friendly name of your site<\/li>\n<li>CHANGE DATABASE (a number between 0 and 15, which needs to be unique and for this website only)<\/li>\n<li>Save changes<\/li>\n<\/ol>\n<\/li>\n<li>Edit your PHP.ini file and add the following line\n<ol>\n<li>extension=php_redis.dll<\/li>\n<li>save<\/li>\n<\/ol>\n<\/li>\n<li>Go to the WordPress Admin<\/li>\n<li>Plugins, Add new Plugin<\/li>\n<li>Search for REDIS<\/li>\n<li>clock on REDIS OBJECT CACHE, click install<\/li>\n<li>click Activate<\/li>\n<li>\u00a0Look at the REDIS plugin\n<ol>\n<li>SETTINGS-&gt;REDIS<\/li>\n<\/ol>\n<\/li>\n<li>Hopefully you will see three green checkboxes, which means your REDIS cache is up and running.\n<ol>\n<li><a href=\"http:\/\/www.amixa.com\/blog\/wp-content\/uploads\/2023\/04\/2023-04-14_09-49-06.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-629 \" src=\"http:\/\/www.amixa.com\/blog\/wp-content\/uploads\/2023\/04\/2023-04-14_09-49-06.jpg\" alt=\"\" width=\"346\" height=\"547\" srcset=\"https:\/\/www.amixa.com\/blog\/wp-content\/uploads\/2023\/04\/2023-04-14_09-49-06.jpg 602w, https:\/\/www.amixa.com\/blog\/wp-content\/uploads\/2023\/04\/2023-04-14_09-49-06-190x300.jpg 190w\" sizes=\"auto, (max-width: 346px) 100vw, 346px\" \/><\/a><\/li>\n<\/ol>\n<\/li>\n<li>If you don&#8217;t have three green checkmarks as above, I am available for consultation on your project.\u00a0 <a href=\"https:\/\/www.amixa.com\/contact.asp\">Please reach out to me here<\/a>.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Note:\u00a0 This presumes you already have a working REDIS server inside your LAN.\u00a0 If you don&#8217;t, please see my coming post on how to set up a REDIS virtual machine on HYPER-V. &nbsp; You will need to install the php REDIS extension.\u00a0 I am using IIS 10 and Windows Server 2022, so I went to this page: https:\/\/pecl.php.net\/package\/redis and downloaded<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,146,148,147],"tags":[152,150,153,43,149,151,42],"class_list":["post-627","post","type-post","status-publish","format-standard","hentry","category-iis-tips-n-tricks","category-php","category-redis","category-wordpress","tag-caching","tag-iis-10","tag-object-cache","tag-php","tag-redis","tag-windows-server-2022","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.amixa.com\/blog\/wp-json\/wp\/v2\/posts\/627","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.amixa.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.amixa.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.amixa.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.amixa.com\/blog\/wp-json\/wp\/v2\/comments?post=627"}],"version-history":[{"count":2,"href":"https:\/\/www.amixa.com\/blog\/wp-json\/wp\/v2\/posts\/627\/revisions"}],"predecessor-version":[{"id":631,"href":"https:\/\/www.amixa.com\/blog\/wp-json\/wp\/v2\/posts\/627\/revisions\/631"}],"wp:attachment":[{"href":"https:\/\/www.amixa.com\/blog\/wp-json\/wp\/v2\/media?parent=627"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.amixa.com\/blog\/wp-json\/wp\/v2\/categories?post=627"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.amixa.com\/blog\/wp-json\/wp\/v2\/tags?post=627"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}