Easy Tutorial
❮ Memcached Tutorial Php Connect Memcached ❯

Installing Memcached on Windows

The official website does not provide a Windows platform installation package for Memcached. You can use the following links to download it. You need to click the corresponding link based on your system platform and the required version number:

Before version 1.4.5, Memcached could be installed as a service, but this feature was removed in version 1.4.5 and later. Therefore, we will introduce the different installation methods for versions 1.4.4 and 1.4.5:


Installing Memcached <1.4.5 Version

  1. Extract the downloaded installation package to a specified directory.

  2. Before version 1.4.5, Memcached could be installed as a service. Run the following command with administrator privileges:

    c:\memcached\memcached.exe -d install
    

Note: You need to replace c:\memcached\memcached.exe with the actual path.

  1. Then you can use the following commands to start and stop the Memcached service:

    c:\memcached\memcached.exe -d start
    c:\memcached\memcached.exe -d stop
    
  2. To modify the configuration of Memcached, you can open the Registry Editor by running regedit.exe and navigate to "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\memcached" to make changes.

To provide cache configuration for Memcached, modify ImagePath to:

"c:\memcached\memcached.exe" -d runservice -m 512

-m 512 means setting the maximum cache configuration for Memcached to 512M.

Additionally, you can view more parameter configurations using the command "c:\memcached\memcached.exe -h".

  1. If you need to uninstall Memcached, use the following command:
    c:\memcached\memcached.exe -d uninstall
    

Installing Memcached >= 1.4.5 Version

  1. Extract the downloaded installation package to a specified directory.

  2. After version 1.4.5, Memcached cannot run as a service and needs to be started as a regular process using Task Scheduler to run automatically at Windows startup.

Run the following command with administrator privileges to add Memcached to the Task Scheduler:

schtasks /create /sc onstart /tn memcached /tr "'c:\memcached\memcached.exe' -m 512"

Note: You need to replace c:\memcached\memcached.exe with the actual path.

Note: -m 512 means setting the maximum cache configuration for Memcached to 512M.

Note: You can view more parameter configurations using the command "c:\memcached\memcached.exe -h".

  1. To remove the Memcached task from the Task Scheduler, use the following command:
    schtasks /delete /tn memcached
    
❮ Memcached Tutorial Php Connect Memcached ❯