{"id":275,"date":"2014-05-06T16:19:04","date_gmt":"2014-05-06T16:19:04","guid":{"rendered":"https:\/\/qbytes.cloud\/?p=275"},"modified":"2014-05-06T16:19:04","modified_gmt":"2014-05-06T16:19:04","slug":"how-to-install-php-memcache","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2014\/05\/06\/how-to-install-php-memcache\/","title":{"rendered":"Install the Memcache PECL Extension"},"content":{"rendered":"<p>The easiest installation method for memcache is to use PECL\u2019s \u2018install\u2019 command. This will grab the latest stable release, configure it with the default options, and add it to the server\u2019s php.ini:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\npecl install memcache\n<\/pre>\n<p>Un-installation is just as easy:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\npecl uninstall memcache\n<\/pre>\n<p>Now add the extension so it will load<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nnano \/etc\/php.d\/memcache.ini\n<\/pre>\n<p>Add the following<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n; Enable memcache extension module\nextension=memcache.so\n\n<\/pre>\n<p>Restart apache<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nservice httpd restart\n<\/pre>\n<p>The quick install method for memcache uses the default configuration options and should serve most users\u2019 purposes. However, if you need more control over the installation options, you can manually install from source and add it flags as you need.<\/p>\n<p>1. Download the source package via PECL:<\/p>\n<p>cd \/usr\/local\/src\/<br \/>\npecl download memcache<\/p>\n<p>2. Unpack the tar and enter into the newly extracted directory (be sure to replace the X\u2019s with your downloaded version):<\/p>\n<p>tar -xvzf memcache-X.X.X.tgz<br \/>\ncd memcache-X.X.X<\/p>\n<p>3. Configure and install:<\/p>\n<p>\/usr\/local\/bin\/phpize<br \/>\n.\/configure \u2013with-php-config=\/usr\/local\/bin\/php-config<\/p>\n<p>Note: If you are working on a server with cPanel, keep in mind that cPanel itself installs two versions of php:<\/p>\n<p>\/usr\/bin\/php<br \/>\n\/usr\/local\/bin\/php<\/p>\n<p>For that reason you have to know which version your web server is actually using. Most of the time it is \/usr\/local\/bin\/php. It can get very confusing and can be different from server to server. If you are a ServInt customer, don\u2019t hesistate to fill out a support ticket if you have any questions.<\/p>\n<p>4. Verify the install:<\/p>\n<p>Verify the installation by displaying all the installed PHP modules. See if memcache is listed:<\/p>\n<p>php -m<br \/>\nmemcache<br \/>\nProblems with manual installation<\/p>\n<p>The \u201cmake install\u201d should load the module into your server\u2019s extension directory automatically. However, if you do not see memcache listed in a \u201cphp -m\u201d, you will need to add the module manually.<\/p>\n<p>1. First, verify the location of your server\u2019s extensions directory:<\/p>\n<p>grep extension_dir \/usr\/local\/lib\/php.ini<\/p>\n<p>It should return something similar to the following:<\/p>\n<p>extension_dir = \u201c\/usr\/local\/lib\/php\/extensions\/no-debug-non-zts-20060613\u2033<\/p>\n<p>2. Next, copy the memcache module into that directory (be sure to replace the path with the one found on your server):<\/p>\n<p>cp modules\/memcache.so \/usr\/local\/lib\/php\/extensions\/no-debug-non-zts-20060613<\/p>\n<p>3. Finally, add the module to your php.ini:<\/p>\n<p>echo \u2018extension=memcache.so\u2019 >> \/usr\/local\/lib\/php.ini<br \/>\nFinal Thoughts<\/p>\n<p>It used to be a common issue that the quick \u2018install\u2019 method could not be used for servers where the \/tmp partition was mounted \u201cnoexec\u201d. The problem was that the \u201cconfigure\u201d process could not execute because the PECL client downloaded the module into in \/tmp. When \/tmp is mounted \u201cnoexec\u201d, servers cannot execute scripts from \/tmp.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The easiest installation method for memcache is to use PECL\u2019s \u2018install\u2019 command. This will grab the latest stable release, configure it with the default options, and add it to the server\u2019s php.ini: pecl install memcache Un-installation is just as easy: pecl uninstall memcache Now add the extension so it will load nano \/etc\/php.d\/memcache.ini Add the &#8230; <a title=\"Install the Memcache PECL Extension\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2014\/05\/06\/how-to-install-php-memcache\/\" aria-label=\"Read more about Install the Memcache PECL Extension\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[65],"tags":[],"class_list":["post-275","post","type-post","status-publish","format-standard","hentry","category-memcached"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/275","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=275"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/275\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=275"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=275"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}