How to Install Gearman on Windows 11
Gearman is a popular job server that is used in various web applications to distribute tasks to multiple workers. In this tutorial, we will guide you through the steps to install Gearman on Windows 11.
Prerequisites
To complete this tutorial, you need:
- A Windows 11 machine with administrative privileges
- PowerShell
Step 1: Download the Gearman Binary
To download the Gearman binary, go to the Gearman website's download section and select the appropriate binary for Window 11. For instance, select the gearman-1.1.19-1-VC14-x86_64.zip file.
Step 2: Extract the Binary
Extract the downloaded binary to a folder of your choice. For instance, create a folder "gearman" in the "C:" drive and extract the binary to this folder.
Step 3: Add Gearman Path to System Environment Variables
To enable the system to use the Gearman binary, add the Gearman path to the system environment variables as follows:
- Press the
Windows + Rkey to open the Run dialog box. - Enter
sysdm.cplin the text box and click OK. - Click on the "Advanced" tab.
- Click on the "Environment Variables" button.
- Under "System Variables", click on the "New" button.
- Enter
GEARMAN_ROOTas the variable name and the path to the Gearman binary as the variable value. For instance,C:\gearman. - Click on the "OK" button to save.
Step 4: Install the Gearman PHP Extension (Optional)
If you are using PHP with Gearman, you may want to install the Gearman PHP extension. To install the Gearman PHP extension:
- Open PowerShell with administrative privileges.
- Enter the following command:
pecl install gearman-1.1.2 - If prompted, enter the Gearman path that you added to the system environment variables in step 3.
- Restart your Apache or Nginx server.
Step 5: Verify the Gearman Installation
To verify that Gearman is properly installed, open PowerShell and enter the following command:
gearadmin --version
If Gearman is properly installed, it should display the version number.
Conclusion
Congratulations! You have successfully installed Gearman on Windows 11. Now you can use Gearman to distribute tasks to multiple workers in your web applications.