青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

xiaoguozi's Blog
Pay it forword - 我并不覺(jué)的自豪,我所嘗試的事情都失敗了······習(xí)慣原本生活的人不容易改變,就算現(xiàn)狀很糟,他們也很難改變,在過(guò)程中,他們還是放棄了······他們一放棄,大家就都是輸家······讓愛(ài)傳出去,很困難,也無(wú)法預(yù)料,人們需要更細(xì)心的觀察別人,要隨時(shí)注意才能保護(hù)別人,因?yàn)樗麄兾幢刂雷约阂裁础ぁぁぁぁ?/span>

Recently I've come face-to-face with a significant processing task for a web application written in PHP.  I haven't worked with process control very much, so I started researching ways of distributing the calculations to multiple processes.  PHP offers several libraries for doing this (pcntl, POSIX), but it quickly became clear that if you're running Windows these libraries are not an option, and unfortunately at work I have a Windows machine.  After a lot more research, I came across Gearman.

Gearman is essentially a distributed processing framework, and seems to have community support for many programming languages.  It consists of two main components: the job server, and a Client and Worker API.  The Client and Worker API can be used in a wide variety of languages, but the job server is only available as a C library or a Perl library.  This makes it a bit tougher to get the server running on Windows, especially when you start running into some of the dependencies that it requires to build.  As well, the Client/Worker API for PHP can only be installed as a PECL extension, or a very-out-of-date PEAR extension called Net_Gearman.

Nonetheless, after yet more research I decided that I would give it a shot by using Cygwin to get the job server running (if you haven't used Cygwin before, be sure to read about it before attempting to install Gearman this way), and PEAR to use the API.  Pre-built PECL extensions aren't available for Windows anymore, and the build process for PHP extensions can be pretty painful, so it makes PEAR look good by comparison even if the code will be out of date.

I had a pretty frustrating time finally getting everything up and running due to various dependency issues, so I went back through the whole process and wrote it out step-by-step.  I used a Windows XP SP3 machine for this, but I also got it working on a Windows 7 machine as well.

Installing the Gearman job server (gearmand) on Windows with Cygwin

Installing Cygwin

  1. If you don't have Cygwin already, you can get it from http://www.cygwin.com.  The setup file is located here, and the setup process is pretty straightforward; run it and follow the wizard.  Full installation instructions are available at the Cygwin site.
  2. Keep the Cygwin setup.exe file handy after you've installed the default software packages, as you'll need it in the future to add packages, similar to apt-get, yum, and other Linux/UNIX package managers.
  3. Cygwin installs with some basic packages, including a Cygwin Bash Shell that goes into your Start Menu.  I prefer the mintty emulator instead, as it has less of a DOS Command Prompt feel and better terminal features.  Feel free to use whatever shell you like of course.  You can get mintty by re-running the setup.exe, and at the package selection screen, type 'mintty' into the Search bar at the top left.  Expand the "Shells" category, and click on the word "Skip" under the "New" column beside the mintty package to select it before continuing the install process.

Installing Cygwin Package Dependencies needed for Gearman

If you're not already in the Cygwin setup, re-run the Cygwin setup.exe and go through to the package selection screen.  The following is a list of dependency packages you will need in order to build the Gearman job server (gearmand).  None of these packages were installed by default with Cygwin:

  • gcc
  • make
  • libuuid1-devel
  • libiconv

There's a good installation tutorial here that walks through getting gcc and make installed for people unfamiliar with Cygwin.  Finding the others is pretty straightforward, the Search bar in the package selector works well.

Installing libevent

Gearmand requires an event notification library called libevent that you cannot get as a Cygwin package, which means it has to be installed from source.  You can get the source here.

  1. Download and unpack the latest libevent stable release.  At the time of this writing, I used libevent-1.4.14b-stable.
    NOTE: Download and unpack to a directory that does not contain spaces in the name, such as "C:/cygwin/home/Zombat/libevent-1.4.14b-stable".  If you unpack to something with spaces like "C:/Documents and Settings/Zombat/", the build process might not be able to install libevent correctly (libtool has a hard time with spaces)!
  2. Open a Cygwin shell and cd to the unpacked libevent directory.
  3. Run the following commands:

./configure
make
make install

libevent should now be installed and ready to be used when compiling the Gearman job server.

Installing the Gearman job server, gearmand.exe

  1. Download and unpack the C implementation of gearmand from http://gearman.org/index.php?id=download
  2. Open a cygwin shell and cd to your unpacked gearmand directory.  Same rules apply as before, make sure you've unpacked in a directory with no spaces in the path!  libtool hates that, and your build may fail.
  3. Run the following commands:

./configure
make
make install

The Gearman job server should now be installed and ready to use!  Mine was installed at /usr/local/sbin/gearmand.exe, and running it with a "triple verbose" flag (-vvv) should produce the following:

gearmand.exe startup debug output

That's it for the job server.  When you want to start it, simply open a Cygwin shell and run gearmand.exe.  Running it with the -d flag will cause the server to run as a daemon in the background, and running with --help will show you the full option list.

Installing the Gearman Client and Worker API (Net_Gearman)

I chose to install the PEAR Client and Worker API, as it is native PHP and doesn't involve compiling PECL extensions.  The PEAR package is called Net_Gearman, and was originally written by Joe Stump at Digg.com.  It is old and out of date now, although there appears to be a more recent fork at http://github.com/brianlmoon/net_gearman.  I stuck with the older version, as I suspect it will meet my needs, and was readily available as a PEAR package.

This also makes installation relatively painless.  Assuming you've previously set PEAR up, then all you have to do is open a command window (not a Cygwin shell) and run:

pear install Net_Gearman-alpha

The "-alpha" portion is necessary, as Net_Gearman apparently never made it to a stable release version.  That being said, it has functioned well for me so far.  Perhaps someone will pick the project up in the future.

I'll write more about getting started with the Client and Worker API in the next article, so we can actually use Gearman to get some work done.

轉(zhuǎn)自:
http://www.phpvs.net/2010/11/30/installing-gearman-and-gearmand-on-windows-with-cygwin/
posted on 2012-12-28 11:17 小果子 閱讀(2637) 評(píng)論(0)  編輯 收藏 引用 所屬分類: 學(xué)習(xí)筆記C++
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            亚洲二区在线观看| 亚洲视频中文| 亚洲一区黄色| 亚洲一区二区三区免费在线观看| 亚洲免费观看视频| aa级大片欧美三级| 亚洲一区在线免费观看| 亚洲无人区一区| 午夜精品一区二区三区在线播放| 亚洲综合精品一区二区| 小黄鸭精品aⅴ导航网站入口| 欧美一区二区三区免费视| 欧美专区一区二区三区| 美玉足脚交一区二区三区图片| 欧美激情1区2区3区| 亚洲精品免费在线播放| 欧美激情久久久久| 日韩视频欧美视频| 欧美一区二区三区四区夜夜大片| 久久久久综合一区二区三区| 欧美电影免费观看高清完整版| 欧美日韩天堂| 激情成人av| 亚洲视频在线一区观看| 久久久久久久久一区二区| 亚洲承认在线| 午夜在线一区| 欧美精品自拍偷拍动漫精品| 国产欧美日韩免费| 亚洲欧洲精品一区二区三区| 午夜日本精品| 最新中文字幕一区二区三区| 午夜精品www| 亚洲午夜在线观看视频在线| 鲁鲁狠狠狠7777一区二区| 香蕉乱码成人久久天堂爱免费| 久久久爽爽爽美女图片| 欧美午夜精品久久久久久超碰| 韩国精品久久久999| 亚洲一区二区视频在线| 女女同性精品视频| 午夜欧美精品久久久久久久| 欧美激情一区在线观看| 黄色另类av| 欧美亚洲视频在线看网址| 亚洲国产精品一区制服丝袜| 欧美中文字幕不卡| 国产精品日韩欧美综合| 99re视频这里只有精品| 玖玖视频精品| 午夜日韩在线观看| 国产精品久久久久久一区二区三区| 91久久久久久久久| 久久综合999| 欧美一区视频在线| 国产精品久久国产精麻豆99网站| 亚洲精品永久免费| 欧美大片在线影院| 久久久99精品免费观看不卡| 国产麻豆成人精品| 午夜国产欧美理论在线播放| 99国产精品自拍| 欧美啪啪成人vr| 亚洲精选国产| 91久久嫩草影院一区二区| 美女在线一区二区| 亚洲国产精品一区二区第一页 | 欧美精品一区二区视频 | 一区二区三区四区蜜桃| 欧美精品国产一区| 中日韩男男gay无套| 这里只有精品丝袜| 国产美女精品视频免费观看| 久久精品在这里| 久久成人精品电影| 伊人婷婷欧美激情| 亚洲黄色免费| 欧美三级视频| 久久精品国产成人| 老司机精品导航| 在线视频欧美精品| 亚洲欧美日韩一区二区在线| 激情综合五月天| 亚洲国产精品日韩| 欧美亚洲不卡| 久久中文久久字幕| 欧美日韩中文字幕在线视频| 欧美激情国产日韩| 国产视频观看一区| 亚洲高清不卡在线观看| 欧美日韩在线精品| 久久综合999| 欧美日韩一区二区三区在线看| 欧美一区深夜视频| 欧美大片第1页| 欧美诱惑福利视频| 欧美黑人多人双交| 欧美中文在线免费| 欧美精品福利视频| 久久久久免费视频| 欧美伦理影院| 嫩草伊人久久精品少妇av杨幂| 欧美日韩精品二区| 老色批av在线精品| 国产精品美女诱惑| 亚洲国产精品va在线看黑人| 国产日韩欧美亚洲| 99亚洲伊人久久精品影院红桃| 黄色小说综合网站| 亚洲一区二区三区四区视频| 亚洲国产视频一区| 香蕉久久国产| 亚洲一区二区三区三| 免费久久精品视频| 久久婷婷影院| 国产日韩精品视频一区二区三区| 亚洲精品国产精品乱码不99按摩| 极品少妇一区二区| 羞羞答答国产精品www一本 | 亚洲精品欧美日韩专区| 亚洲欧洲av一区二区三区久久| 亚洲精品三级| 老司机精品导航| 免费h精品视频在线播放| 国产欧美婷婷中文| 亚洲一区二区免费看| 亚洲桃色在线一区| 欧美精品99| 91久久精品国产| 亚洲黄色影院| 欧美a一区二区| 亚洲电影欧美电影有声小说| 亚洲高清一区二| 毛片基地黄久久久久久天堂| 老司机精品久久| 在线观看一区| 麻豆成人在线观看| 欧美第一黄色网| 亚洲欧洲日产国产综合网| 久久久久久久性| 久久夜色精品国产欧美乱| 国产手机视频一区二区| 香蕉免费一区二区三区在线观看| 欧美在线播放一区| 国产日韩精品在线观看| 性一交一乱一区二区洋洋av| 久久男人资源视频| 一区二区三区在线免费观看| 久久亚洲精品视频| 亚洲激情二区| 亚洲综合三区| 国内精品免费在线观看| 久久这里只有精品视频首页| 久久在线播放| 久久99在线观看| 99精品国产在热久久下载| 一本色道久久综合亚洲91| 欧美日韩中字| 午夜国产精品视频| 欧美成人按摩| 正在播放亚洲| 国产日韩欧美在线一区| 老色批av在线精品| 99天天综合性| 久久综合五月| 亚洲深夜av| 狠狠操狠狠色综合网| 欧美国产日韩精品免费观看| 亚洲一区二区在线视频| 蜜桃av噜噜一区| 亚洲免费小视频| 1000部国产精品成人观看| 欧美日韩在线直播| 久久久久久夜精品精品免费| 日韩亚洲不卡在线| 老司机aⅴ在线精品导航| 亚洲一区二区成人在线观看| 韩国精品在线观看| 欧美午夜宅男影院| 久久九九99视频| 一区二区三区精品在线| 女生裸体视频一区二区三区| 亚洲综合好骚| 亚洲最黄网站| 在线观看91久久久久久| 欧美视频在线免费看| 久久久免费观看视频| 一区二区三区精品视频| 亚洲国产精品久久久久秋霞影院| 午夜精品久久| av不卡免费看| 亚洲精品日韩综合观看成人91| 好吊色欧美一区二区三区视频| 欧美性猛片xxxx免费看久爱 | 亚洲午夜一区二区三区| 另类亚洲自拍| 欧美一区二区三区四区视频| 9色精品在线| 亚洲欧洲在线观看| 在线精品一区|