Skip to content

Technology Forum

SEO, Speed Up website, Server Optimization, Linux, Open Source Softwares

  • Home
  • General
    • Web Server
    • Website Formatting
  • IT Companies
  • Optimization
    • PHP
  • Linux
  • Home
  • Optimization
  • PHP
  • Enable memcache in WAMP
Linux
Manage and Tweak Dedicated Linux Hosting Web Server
PHP
TIPS
Optimization
eAccelerator
Web Server
HTTP header and Server Response Codes
General
Search Engine Optimization
PHP
SSL Certificate

Enable memcache in WAMP

Posted on November 26, 2017November 26, 2017 By admin No Comments on Enable memcache in WAMP
PHP

Download memcache for windows (DLL) from https://pecl.php.net/package/memcache

Extract the files (php_memcache.dll & php_memcache.pdb) and put in <drive>\wamp\bin\php\phpx.x.xx\ext

Update php.ini file with extension=php_memcache.dll (run test page with phpinfo and check “Loaded Configuration File” for php.ini configuration file )

Run following script to test memcache

$memcache = new Memcache;
$memcache->connect('localhost', 11211) or die ("Could not connect");
$version = $memcache->getVersion();
echo "Server's version: ".$version."<br/>\n";
$tmp_object = new stdClass;
$tmp_object->str_attr = 'test';
$tmp_object->int_attr = 123;
$memcache->set('key', $tmp_object, false, 10) or die ("Failed to save data at the server");
echo "Store data in the cache (data will expire in 10 seconds)<br/>\n";
$get_result = $memcache->get('key');
echo "Data from the cache:<br/>\n";

var_dump($get_result);

Output:

 Server's version: 1.4.4-14-g9c660c0
 Store data in the cache (data will expire in 10 seconds)
 Data from the cache:
E:\Websites\httpdocs\index.php:43: 
object(stdClass)[3]
  public 'str_attr' => string 'test' (length=4)
  public 'int_attr' => int 123
Tags: Install Memcache in WAMP Memcache WAMP Setup Memcache in WAMP Windows-Apache-MySQL-PHP

Post navigation

❮ Previous Post: How to Force detecting the Social Profiles associated with a Website
Next Post: Resolving Public DNS Server List ❯

You may also like

PHP
Plesk/Odin Services Structure
PHP
Goodbye to DDOS
PHP
Encrypt and Decrypt for URL Using PHP
PHP
Remove Apps from Windows 10

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Enter Captcha Here : *

Reload Image

View Posts

  • HTML: Link rel – Preload
  • HTML: Attributes of rel
  • Linux Commands
  • Security HTTP Headers
  • WCAG 2.0 checklist

Categories

  • Domain Name
  • General
    • Servers
    • Web Server
    • Website Formatting
  • IT Companies
  • Linux
  • MySQL
  • Optimization
    • PHP
  • Troubleshooting
  • Web Hosting Control Panel
    • Plesk Panel
  • Websites
    • CSS
    • HTML
    • Optimization
  • Windows
    • Windows 10

Recent Posts

  • HTML: Link rel – Preload
  • HTML: Attributes of rel
  • Linux Commands
  • Security HTTP Headers
  • WCAG 2.0 checklist

Copyright © 2023 Technology Forum.