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

xiaoguozi's Blog
Pay it forword - 我并不覺的自豪,我所嘗試的事情都失敗了······習(xí)慣原本生活的人不容易改變,就算現(xiàn)狀很糟,他們也很難改變,在過程中,他們還是放棄了······他們一放棄,大家就都是輸家······讓愛傳出去,很困難,也無法預(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 小果子 閱讀(2655) 評(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>
            久久青青草原一区二区| 狂野欧美激情性xxxx欧美| 欧美日韩国产大片| 99热这里只有精品8| 91久久精品美女高潮| 欧美成人午夜剧场免费观看| 亚洲国产婷婷香蕉久久久久久| 免费一区视频| 欧美国产日韩视频| 亚洲午夜久久久久久久久电影网| 在线中文字幕不卡| 国产一区二区三区在线观看精品 | 亚洲电影免费观看高清完整版在线观看 | 亚洲在线一区| 黑人一区二区| 亚洲国产婷婷香蕉久久久久久99| 欧美日韩亚洲国产一区| 性久久久久久久| 免费高清在线一区| 亚洲桃花岛网站| 久久精品国产亚洲高清剧情介绍| 亚洲国产成人91精品| 9国产精品视频| 一区二区在线观看视频| 亚洲人体偷拍| 国产一区二区三区奇米久涩| 欧美激情精品久久久久久免费印度 | 亚洲欧美精品中文字幕在线| 亚洲电影av| 亚洲一区二区在线免费观看| 在线观看日韩| 亚洲欧美视频一区| 日韩视频在线你懂得| 欧美一区在线看| 在线午夜精品| 免费成人黄色av| 久久精品一区中文字幕| 欧美美女喷水视频| 美女精品在线| 国产美女精品免费电影| 最新国产精品拍自在线播放| 国产一区二区三区免费不卡| 一本大道久久a久久综合婷婷 | 国产精品爽爽爽| 亚洲三级国产| 亚洲七七久久综合桃花剧情介绍| 亚洲欧美激情在线视频| 一区二区三区偷拍| 噜噜噜躁狠狠躁狠狠精品视频| 欧美怡红院视频| 国产精品成人午夜| 99精品福利视频| 一本不卡影院| 欧美高清视频免费观看| 欧美成人免费观看| 在线观看91精品国产麻豆| 性xx色xx综合久久久xx| 亚洲欧美中文日韩v在线观看| 欧美另类视频在线| 亚洲国产精品999| 亚洲日韩成人| 欧美国产一区二区| 亚洲国产精品久久久久秋霞不卡| 在线观看国产成人av片| 久久久www成人免费精品| 久久久久久久999| 黄色精品网站| 久久婷婷人人澡人人喊人人爽| 久久一区欧美| 在线观看国产精品淫| 理论片一区二区在线| 欧美二区乱c少妇| 亚洲人体偷拍| 欧美日韩性生活视频| 夜夜狂射影院欧美极品| 亚洲一区二区三区视频播放| 欧美三级电影大全| 亚洲天堂免费在线观看视频| 欧美一区二区免费| 国内视频精品| 卡通动漫国产精品| 亚洲精品日韩久久| 亚洲伊人久久综合| 国产一区二区三区四区老人| 久久夜色精品国产欧美乱| 亚洲国产精品成人一区二区| 亚洲美女黄网| 国产精品乱码妇女bbbb| 午夜精品久久久久久99热| 亚洲欧美视频一区二区三区| 国精品一区二区三区| 欧美成人福利视频| 在线亚洲精品| 久久资源av| 在线亚洲电影| 好看的日韩av电影| 欧美精品一区二区三区高清aⅴ| 一区二区三区四区五区精品视频| 久久成人av少妇免费| 在线欧美日韩精品| 欧美日韩国产综合网| 亚洲欧美日韩精品久久| 欧美激情亚洲激情| 亚洲欧美一区在线| 亚洲高清自拍| 国产精品一区二区你懂的| 免费看的黄色欧美网站| 亚洲欧美一区二区视频| 亚洲高清久久| 久久噜噜噜精品国产亚洲综合| 亚洲国产精品视频一区| 国产麻豆一精品一av一免费| 欧美成人午夜免费视在线看片| 亚洲欧美成aⅴ人在线观看| 欧美国产日韩精品| 久久九九免费视频| 亚洲综合成人在线| 亚洲日本成人网| 国产综合久久久久久| 国产精品www| 欧美人交a欧美精品| 久久久久成人精品| 亚洲一区二区久久| 亚洲精品中文字幕在线| 欧美电影在线观看| 久久久久久久97| 欧美一区国产二区| 亚洲欧美另类在线观看| 日韩亚洲不卡在线| 91久久久久久国产精品| 狠狠网亚洲精品| 国产女精品视频网站免费| 欧美午夜精品理论片a级大开眼界| 久久综合999| 久久久久青草大香线综合精品| 欧美一区二区网站| 性欧美1819性猛交| 欧美一级网站| 欧美伊人影院| 久久精品国产久精国产思思 | 美国十次了思思久久精品导航| 久久av资源网站| 欧美一级专区免费大片| 午夜精品婷婷| 欧美在线播放高清精品| 欧美一区二区三区啪啪| 欧美一二三区精品| 久久精品国产成人| 久久精品亚洲一区二区三区浴池 | …久久精品99久久香蕉国产 | 国产主播一区二区三区四区| 国产欧美一区二区三区国产幕精品 | 亚洲欧美视频在线观看| 午夜精品国产精品大乳美女| 午夜精品福利在线| 久久蜜桃精品| 欧美成人影音| 欧美偷拍另类| 国产乱码精品一区二区三| 国内精品嫩模av私拍在线观看| 国产揄拍国内精品对白| 依依成人综合视频| 日韩视频第一页| 亚洲免费在线看| 久久久久久久一区二区| 久久综合中文色婷婷| 91久久中文| 亚洲欧美日韩国产综合| 久久久久综合一区二区三区| 欧美jizzhd精品欧美巨大免费| 欧美日韩一区二区三区四区五区| 国产精品欧美激情| 精品福利电影| 一区二区三区四区在线| 久久精品综合一区| 亚洲电影免费在线 | 乱人伦精品视频在线观看| 91久久久久久久久| 亚洲一区在线播放| 六月丁香综合| 国产精品美女www爽爽爽| 在线观看亚洲专区| 亚洲性线免费观看视频成熟| 久久夜色精品国产噜噜av| 亚洲激情中文1区| 欧美在线亚洲一区| 欧美午夜激情视频| 一色屋精品亚洲香蕉网站| 一区二区三区视频在线看| 久久婷婷国产麻豆91天堂| 一本色道久久加勒比88综合| 久久精品亚洲精品国产欧美kt∨| 欧美日韩成人在线播放| 黄色av一区| 午夜精品一区二区三区电影天堂 | 中日韩在线视频| 欧美高清在线一区| 羞羞答答国产精品www一本| 欧美精品123区| 亚洲成人在线网站|