如何在 Windows 操作系统中配置或安装 GEARMAN?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5580956/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to configure or install GEARMAN in windows OS?
提问by Chandru
I want to implement "GEARMAN" in project but I don't know how to install or configure "GEARMAN" in windows OS. Can anyone provide me any link from where I can work with "GEARMAN"?
我想在项目中实现“GEARMAN”,但我不知道如何在 Windows 操作系统中安装或配置“GEARMAN”。任何人都可以为我提供任何可以与“GEARMAN”合作的链接吗?
回答by cpk
Gearman has to be compiled under the cygwin environment :
- install cygwin and open the shell;
- download and install libevent;
- download and install gearman server.
Gearman 必须在 cygwin 环境下编译:
- 安装 cygwin 并打开 shell;
- 下载并安装 libevent;
- 下载并安装齿轮服务器。
Here is a more detailed tutorial : http://www.phpvs.net/2010/11/30/installing-gearman-and-gearmand-on-windows-with-cygwin/.
这是更详细的教程:http: //www.phpvs.net/2010/11/30/installing-gearman-and-gearmand-on-windows-with-cygwin/。
回答by Siddiq Abu Bakkar
Official website for "Gearman" is best I believe. You can find out "Documentation", "How to install" & "Examples" in this site : http://gearman.org/
我相信“Gearman”的官方网站是最好的。您可以在此站点中找到“文档”、“如何安装”和“示例”:http: //gearman.org/
And also you will get examples here : http://php.net/manual/en/gearman.examples-reverse-task.php
你也会在这里得到例子:http: //php.net/manual/en/gearman.examples-reverse-task.php
Getting Started with "Gearman" : http://gearman.org/getting-started/
“Gearman”入门:http: //gearman.org/getting-started/
On Windows: http://www.phpvs.net/2010/11/30/installing-gearman-and-gearmand-on-windows-with-cygwin/
在 Windows 上:http: //www.phpvs.net/2010/11/30/installing-gearman-and-gearmand-on-windows-with-cygwin/
Best of luck. I believe you will love to work with "Gearman" with full gear.
祝你好运。我相信你会喜欢和“Gearman”一起工作的。
回答by phpnerd
How to install GEAR MAN
如何安装齿轮人
References
参考
- http://www.cppblog.com/guojingjia2006/archive/2012/12/28/196743.html
- https://gist.github.com/mnapoli/5270256( Gearman and libevent folder downloaded and extracted from here )
- https://julienliabeuf.com/installing-pear-windows/
- http://www.smorgasbork.com/2010/06/16/building-a-distributed-app-with-netgearman-part-1/
- https://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx
- https://github.com/brianlmoon/net_gearman( Net folder downloaded from here )
- http://preshing.com/20141108/how-to-install-the-latest-gcc-on-windows/
- http://www.cppblog.com/guojingjia2006/archive/2012/12/28/196743.html
- https://gist.github.com/mnapoli/5270256(从这里下载并提取 Gearman 和 libevent 文件夹)
- https://julienliabeuf.com/installing-pear-windows/
- http://www.smorgasbork.com/2010/06/16/building-a-distributed-app-with-netgearman-part-1/
- https://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx
- https://github.com/brianlmoon/net_gearman(从这里下载的网络文件夹)
- http://preshing.com/20141108/how-to-install-the-latest-gcc-on-windows/
Steps
脚步
- Download cygwin (setup-x86_64.exe)
- Double click setup file
- On select packages change view to -> Category
To install libuuid1-devel, Search for uuid select the followings
- Debug 1.221-2
- Libs 2.25.2-2
- Perl 1.221-2
To install libboost-devel, Search libboost-devel and select the followings
- Libs 1.66.0-15.
To install libmpfr4, Search libmpfr4 and select the followings
- Libs 3.1.6-1p1
- Math 3.1.6-1p1
To install gcc-g++ , Search g++ and select the followings
- Libs 7.3.0-2
Click next to install
Search on windows for cygwin-terminal -> click on it, This should be coming without any errors
Install more packages
Goto CMD
C:\cygwin64> setup-x86_64.exe -q -P make C:\cygwin64> setup-x86_64.exe -q -P boost C:\cygwin64> setup-x86_64.exe -q -P libiconv
Now cygwin installed successfully
- 下载 cygwin (setup-x86_64.exe)
- 双击安装文件
- 在选择包上将视图更改为 -> 类别
安装libuuid1-devel,搜索uuid选择以下
- 调试 1.221-2
- 库 2.25.2-2
- Perl 1.221-2
要安装 libboost-devel,请搜索 libboost-devel 并选择以下内容
- 库 1.66.0-15。
要安装 libmpfr4,搜索 libmpfr4 并选择以下内容
- 库 3.1.6-1p1
- 数学 3.1.6-1p1
要安装 gcc-g++ ,搜索 g++ 并选择以下内容
- 库 7.3.0-2
点击下一步安装
在 windows 上搜索 cygwin-terminal -> 点击它,这应该没有任何错误
安装更多包
转到 CMD
C:\cygwin64> setup-x86_64.exe -q -P make C:\cygwin64> setup-x86_64.exe -q -P boost C:\cygwin64> setup-x86_64.exe -q -P libiconv
现在cygwin安装成功
11.1 Now download gearmand..and libevent...* from (https://gist.github.com/mnapoli/5270256) and paste into --> C:/cygwin64/tmp/
11.1 现在下载 gearmand。. 和自由事件。. .* 来自 ( https://gist.github.com/mnapoli/5270256) 并粘贴到 --> C:/cygwin64/tmp/
=================================================================================
================================================== ================================
Search on windows for cygwin-terminal -> click on it
type -> cd C:
Type --> cd cygwin64/tmp/libevent...*
Type --> ./configure
Type --> make
Type --> make install
在 windows 上搜索 cygwin-terminal -> 点击它
输入 -> cd C:
输入 --> cd cygwin64/tmp/libevent。. .*
输入 --> ./configure
输入 --> 制作
输入 --> 进行安装
Note:
笔记:
Now libevent should be installed on /usr/local/lib, but this path is not in the library path and GCC will not find it automatically.
现在 libevent 应该安装在 /usr/local/lib 上,但是这个路径不在库路径中,GCC 不会自动找到它。
You can copy the generated libraries to /usr/lib:
您可以将生成的库复制到 /usr/lib:
cp /usr/local/lib/libevent* /usr/lib (this is not the cleanest solution, you are welcome to propose an alternative)
cp /usr/local/lib/libevent* /usr/lib(这不是最干净的解决方案,欢迎您提出替代方案)
Now install gearman
现在安装齿轮
If you are in /usr/lib right now, type /cygdrive/c to come to installation folder
Type --> cd tmp
Type --> cd cygwin64/tmp/gearman..
Type --> ./configure
Type --> make
Type --> make install
如果你现在在 /usr/lib 中,输入 /cygdrive/c 到安装文件夹
输入 --> cd tmp
输入--> cd cygwin64/tmp/gearman。.
输入 --> ./configure
输入 --> 制作
输入 --> 进行安装
Note:
笔记:
************** Before this you need to enable port 4730 on windows firewall Goto step 24 ******
************** 在此之前您需要在 Windows 防火墙上启用端口 4730 转到步骤 24 ******
Now the server is installed and you can launch it from a cygwin terminal:
现在服务器已安装,您可以从 cygwin 终端启动它:
/usr/local/sbin/gearmand.exe Or if you want it to be ultra verbose:
/usr/local/sbin/gearmand.exe 或者,如果您希望它非常详细:
/usr/local/sbin/gearmand.exe -vvv You can also start the process and detach it from the terminal:
/usr/local/sbin/gearmand.exe -vvv 您也可以启动该进程并将其与终端分离:
gearmand -d
齿轮 -d
=========================================================================
================================================== ========================
Enabling port 4730 on inbound rules
在入站规则上启用端口 4730
control panel -> System and security -> windows firewall -> Advance settings -> inbound rules
right click inbound rules -> new rule -> Port -> Select Tcp -> Enter port number (4730)
click next -> Give name as "Gearman port"
Finish
控制面板 -> 系统和安全 -> windows 防火墙 -> 高级设置 -> 入站规则
右键入站规则 -> 新规则 -> 端口 -> 选择 Tcp -> 输入端口号(4730)
单击下一步 -> 将名称命名为“Gearman 端口”
结束
==============================================================================
================================================== ============================
Now we need to make gearman communicate with php PEAR
现在我们需要让gearman与php PEAR通信
Reference --> this is for windows xampp -> https://julienliabeuf.com/installing-pear-windows/
参考 --> 这是用于 windows xampp -> https://julienliabeuf.com/installing-pear-windows/
Following steps to install on windows iis server
在 windows iis 服务器上安装的步骤如下
C:\Program Files (x86)\PHP\v7.1
Enter --> system wide
Enter to continue
Proceed to change php.ini
Make sure php.ini -> include_path referst to pear path as follows
;***** Added by go-pear include_path=".;C:\Program Files (x86)\PHP\version.*\pear" ;*****
go to C:\Program Files (x86)\PHP\version.*
Double click PEAR_ENV.reg to add to environment variables
Copy Net folder and paste it inside -- C:\Program Files (x86)\PHP\version.*\pear
On command prompt type -> pear install Net_Gearman-alpha
Enter
Open php.ini paste following line on end ( To enable socket )
extension=php_sockets.dll
C:\Program Files (x86)\PHP\v7.1
输入 --> 系统范围
输入继续
继续修改php.ini
确保 php.ini -> include_path 指向梨路径如下
;***** Added by go-pear include_path=".;C:\Program Files (x86)\PHP\version.*\pear" ;*****
转到 C:\Program Files (x86)\PHP\version.*
双击 PEAR_ENV.reg 添加到环境变量
复制 Net 文件夹并粘贴到里面 -- C:\Program Files (x86)\PHP\version.*\pear
在命令提示符下输入 -> pear install Net_Gearman-alpha
进入
打开 php.ini 在末尾粘贴以下行(启用套接字)
扩展名=php_sockets.dll
Note: Make sure php_sockets.dll exists under php/version.*/ext
注意:确保 php_sockets.dll 存在于 php/version.*/ext 下
Make copy of php.ini and rename it as php-cli.ini ( This is to run on command prompt )
Hooray! that's it, done.
复制 php.ini 并将其重命名为 php-cli.ini(这是在命令提示符下运行)
万岁!就这样,大功告成。
Now you should try demo with following links https://github.com/brianlmoon/net_gearman
现在您应该尝试使用以下链接进行演示 https://github.com/brianlmoon/net_gearman
Note: Don't forget to include libraries also
注意:不要忘记也包含库