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

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>
            久久网站免费| 亚洲成人在线观看视频| 99亚洲精品| 亚洲黄色一区二区三区| 欧美大色视频| 一区二区三区免费观看| 亚洲一区二区三区四区中文| 国产精品一二一区| 美女视频黄a大片欧美| 免费看亚洲片| 亚洲午夜免费视频| 欧美一级一区| 91久久久久久国产精品| 99成人免费视频| 国产精品自拍在线| 美女精品网站| 欧美性jizz18性欧美| 久久国产一区二区| 欧美成人第一页| 亚洲综合电影| 亚洲宅男天堂在线观看无病毒| 一区二区三区欧美| 狠狠综合久久av一区二区小说 | 亚洲天堂免费在线观看视频| 亚洲在线视频观看| 亚洲人成免费| 欧美在线看片| 亚洲一区免费在线观看| 久久久久久穴| 亚洲欧美日韩国产成人| 毛片一区二区三区| 欧美资源在线观看| 欧美四级在线| 亚洲高清视频一区| 国产一区二区日韩精品| 亚洲精品在线免费观看视频| 激情文学一区| 亚洲自拍偷拍福利| 在线中文字幕不卡| 麻豆成人在线| 久久综合久久综合久久| 国产精品少妇自拍| 日韩亚洲综合在线| 亚洲片区在线| 久久免费午夜影院| 欧美影院在线| 国产精品免费一区二区三区观看| 亚洲高清不卡一区| 国产一区二区三区精品久久久 | 美女露胸一区二区三区| 国产嫩草影院久久久久 | 欧美有码在线观看视频| 欧美日韩免费高清| 亚洲欧洲精品一区二区| 在线观看成人小视频| 久久国产视频网| 久久aⅴ国产欧美74aaa| 国产精品日韩欧美一区| 一区二区三区产品免费精品久久75| 亚洲精品九九| 欧美高清视频www夜色资源网| 免费看成人av| 亚洲精华国产欧美| 欧美www在线| 亚洲国产成人av在线 | 欧美性猛交99久久久久99按摩| 亚洲国产另类久久久精品极度| 亚洲国产欧美在线| 女仆av观看一区| 亚洲福利视频一区二区| 亚洲九九爱视频| 欧美日韩国产在线播放| 99在线精品视频| 午夜精品一区二区三区四区 | 国产精品久久久久久影院8一贰佰| 99精品国产福利在线观看免费 | 亚洲精品久久7777| 99视频日韩| 国产精品电影在线观看| 一本色道久久综合亚洲91| 亚洲欧美日韩精品一区二区| 国产精品你懂的在线欣赏| 亚洲欧美日韩另类精品一区二区三区| 欧美一区二区三区四区高清| 精品1区2区3区4区| 欧美+亚洲+精品+三区| 日韩视频精品在线| 香蕉亚洲视频| 亚洲国产mv| 欧美日韩精品伦理作品在线免费观看 | 亚洲电影第三页| 欧美精品在线播放| 亚洲影院色无极综合| 久久久无码精品亚洲日韩按摩| 亚洲国产综合在线| 国产精品va在线| 久久激情五月激情| 亚洲国产精品悠悠久久琪琪 | 狠狠色丁香久久婷婷综合_中| 麻豆成人综合网| 亚洲一区二区免费看| 久久视频一区二区| 一本一本久久a久久精品综合妖精| 国产精品久久久久久久久久久久久久 | 国产精品一区免费视频| 另类图片综合电影| 亚洲一区二区高清| 亚洲韩国一区二区三区| 欧美在线观看网站| 夜夜嗨av一区二区三区网页| 国产日韩欧美中文在线播放| 欧美国产视频日韩| 久久精品国产77777蜜臀| 一区二区三区高清不卡| 欧美高清一区二区| 欧美中文字幕在线观看| 一个色综合导航| 1024精品一区二区三区| 国产精品一区久久久| 欧美金8天国| 麻豆精品在线播放| 久久精品视频免费| 午夜天堂精品久久久久| 夜夜爽www精品| 亚洲国产欧美一区二区三区丁香婷| 久久er精品视频| 亚洲欧美日韩在线综合| 一本一本久久a久久精品综合妖精 一本一本久久a久久精品综合麻豆 | 夜夜嗨av一区二区三区四区 | 久久久精品国产99久久精品芒果| 中文亚洲免费| 亚洲精品久久久久久久久久久久久 | 国产视频欧美| 国产精品久久久一区麻豆最新章节 | 亚洲美女诱惑| 91久久国产综合久久蜜月精品 | 91久久综合亚洲鲁鲁五月天| 在线观看日韩欧美| 国内伊人久久久久久网站视频| 国产精品日韩久久久| 国产精品人成在线观看免费 | 亚洲精品视频在线观看免费| 亚洲大片av| 亚洲黄色精品| 亚洲美洲欧洲综合国产一区| 亚洲区一区二区三区| 亚洲精品黄网在线观看| 亚洲精品在线观看免费| 亚洲精品视频一区| 亚洲精选视频免费看| 亚洲伦理在线免费看| 99视频日韩| 性久久久久久| 久久精品日韩| 麻豆精品精华液| 欧美激情视频一区二区三区在线播放| 欧美成年人视频| 亚洲国产一区在线观看| 日韩五码在线| 亚洲欧美韩国| 久久理论片午夜琪琪电影网| 免费人成网站在线观看欧美高清| 欧美国产第二页| 欧美午夜精品久久久久免费视 | 91久久综合| 亚洲一区三区电影在线观看| 午夜精品久久久久久久99热浪潮| 欧美一区二区三区婷婷月色 | 亚洲在线第一页| 久久久久国产精品www| 欧美电影美腿模特1979在线看| 亚洲国产一区在线观看| 亚洲一区二区免费看| 久久人人爽国产| 欧美手机在线视频| 激情久久五月| 亚洲少妇自拍| 老巨人导航500精品| 亚洲美女av在线播放| 欧美亚洲在线视频| 欧美精品二区| 红桃视频欧美| 亚洲一区二区三区色| 免费在线观看精品| 制服诱惑一区二区| 玖玖视频精品| 国产欧美日韩综合| 一区二区不卡在线视频 午夜欧美不卡在 | 鲁大师影院一区二区三区| 国产精品国产三级国产普通话99| 在线观看亚洲精品视频| 亚洲欧美日韩人成在线播放| 欧美国产日本在线| 性久久久久久久久久久久| 欧美精品久久一区二区| 一区二区三区在线看| 香蕉久久一区二区不卡无毒影院 | 亚洲综合视频一区| 欧美视频在线一区二区三区| 亚洲精品极品|