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

xiaoguozi's Blog
Pay it forword - 我并不覺的自豪,我所嘗試的事情都失敗了······習慣原本生活的人不容易改變,就算現狀很糟,他們也很難改變,在過程中,他們還是放棄了······他們一放棄,大家就都是輸家······讓愛傳出去,很困難,也無法預料,人們需要更細心的觀察別人,要隨時注意才能保護別人,因為他們未必知道自己要什么·····

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.

轉自:
http://www.phpvs.net/2010/11/30/installing-gearman-and-gearmand-on-windows-with-cygwin/
posted on 2012-12-28 11:17 小果子 閱讀(2637) 評論(0)  編輯 收藏 引用 所屬分類: 學習筆記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>
            欧美日韩国产91| 男人插女人欧美| 欧美大尺度在线观看| 亚洲人成久久| 欧美黑人国产人伦爽爽爽| 国产亚洲成av人在线观看导航| 国产一区二区无遮挡| 欧美在线国产| 亚洲一区二三| 国产精品视频免费观看www| 亚洲香蕉在线观看| 一区二区av在线| 国产精品videosex极品| 一区二区国产精品| 欧美福利在线| 欧美88av| 一区二区91| 99伊人成综合| 国产精品羞羞答答| 久久久久久免费| 久久久欧美精品| 91久久精品一区| 亚洲国产一成人久久精品| 欧美日韩福利在线观看| 亚洲一区二区在线看| 亚洲女同在线| 在线观看成人av| 亚洲精品女av网站| 欧美日韩小视频| 久久精品二区三区| 麻豆成人精品| 亚洲自拍三区| 久久精品亚洲乱码伦伦中文| 91久久夜色精品国产九色| 免费不卡在线观看av| 欧美福利一区二区| 亚洲欧美影院| 久久资源在线| 亚洲在线观看免费| 久久九九99视频| 99精品热6080yy久久| 亚洲你懂的在线视频| 国产欧美精品在线| 久久免费视频在线| 欧美区视频在线观看| 欧美中文字幕在线| 欧美成人精品在线视频| 欧美中文在线观看| 欧美—级高清免费播放| 久久蜜桃香蕉精品一区二区三区| 欧美美女bbbb| 欧美日韩另类综合| 久久亚洲综合色| 欧美天天影院| 麻豆亚洲精品| 欧美日韩午夜剧场| 欧美黄色网络| 激情文学一区| 亚洲欧美激情视频在线观看一区二区三区| 亚洲电影自拍| 午夜精品福利视频| 91久久精品国产91久久| 午夜在线播放视频欧美| 亚洲一区二区三区视频| 欧美暴力喷水在线| 久久一区激情| 国产亚洲精品久久久久婷婷瑜伽| 一本久道久久综合狠狠爱| 亚洲精品国产拍免费91在线| 午夜精品久久久久久久99樱桃| 国产精品99久久久久久久久久久久| 久久精品一区二区三区中文字幕 | 亚洲福利视频在线| 一区二区视频欧美| 欧美一区二区三区婷婷月色 | 国产精品久久久久久久久久妞妞 | 亚洲视频在线免费观看| 欧美高清视频| 老司机免费视频一区二区三区| 国产精品视频区| 国产精品99久久久久久宅男| 夜夜嗨网站十八久久| 老司机精品导航| 欧美成人国产| 亚洲人成亚洲人成在线观看图片| 另类激情亚洲| 亚洲成人在线免费| 欧美午夜不卡在线观看免费| 99精品欧美一区二区蜜桃免费| 日韩一区二区精品葵司在线| 欧美高清在线播放| 久久久噜噜噜久久狠狠50岁| 国产午夜精品视频| 久久福利影视| 欧美xx视频| 亚洲免费高清| 欧美性猛交99久久久久99按摩 | 久久一二三四| 亚洲高清视频的网址| 日韩天天综合| 欧美午夜片在线观看| 亚洲免费视频成人| 浪潮色综合久久天堂| 亚洲啪啪91| 欧美日韩免费一区二区三区| 亚洲人成小说网站色在线| 亚洲网在线观看| 国产综合色产| 久久综合色天天久久综合图片| 亚洲男人第一网站| 精品999网站| 欧美激情按摩在线| 亚洲影视九九影院在线观看| 另类激情亚洲| 在线视频一区二区| 国语自产精品视频在线看抢先版结局 | 欧美精品乱人伦久久久久久 | 亚洲欧美日韩精品一区二区| 国产日韩综合| 欧美精品一区二区视频| 亚洲影院在线| 久久天天躁夜夜躁狠狠躁2022| 激情久久久久| 欧美日韩精品二区| 久久久久国产成人精品亚洲午夜| 亚洲精品国产精品久久清纯直播| 亚洲欧美一区二区原创| 亚洲国产视频一区二区| 欧美福利一区二区| 久久精品国产亚洲精品| 日韩视频久久| 欧美电影免费观看| 久久成人18免费网站| 曰韩精品一区二区| 国产精品素人视频| 欧美绝品在线观看成人午夜影视 | 亚洲国产精品久久久久秋霞影院| 久久综合狠狠综合久久激情| 欧美综合国产| 午夜影院日韩| 欧美一级二级三级蜜桃| 亚洲欧美乱综合| 亚洲男人的天堂在线aⅴ视频| 中文一区二区在线观看| avtt综合网| 亚洲午夜av在线| 亚洲一区二区视频在线| 亚洲一区二区三区四区五区午夜| 亚洲视频 欧洲视频| 欧美亚洲一区三区| 欧美一区二区三区视频在线| 欧美一级夜夜爽| 久久精品日韩| 免费欧美电影| 欧美连裤袜在线视频| 欧美日韩无遮挡| 国产精品视频九色porn| 国产视频欧美视频| 一区二区三区在线观看国产| 亚洲国产日韩在线| 夜夜嗨av一区二区三区四季av | 在线免费观看成人网| 亚洲国产精品成人| 99国产精品私拍| 亚洲欧美精品| 麻豆av福利av久久av| 欧美高清在线视频| 99视频精品免费观看| 午夜精品久久久久久99热| 久久免费视频这里只有精品| 欧美黄在线观看| 国产欧美日韩一级| 亚洲国产精品成人久久综合一区| 中日韩美女免费视频网址在线观看 | 亚洲精品乱码久久久久久蜜桃91| 中文欧美日韩| 久久久噜噜噜久久中文字免| 欧美精品一区二区视频| 国产精品亚发布| 亚洲国产一区在线| 亚洲欧洲av一区二区| 免费在线观看成人av| 一二三区精品| 久久综合中文| 国产精品日韩电影| 亚洲精品国产精品国自产在线| 午夜精品成人在线| 亚洲成人在线视频播放| 亚洲午夜未删减在线观看| 久久婷婷人人澡人人喊人人爽| 国产精品av久久久久久麻豆网| 极品少妇一区二区三区| 亚洲免费视频成人| 亚洲国产91精品在线观看| 午夜视频一区二区| 欧美体内谢she精2性欧美| 亚洲激情综合| 麻豆精品一区二区av白丝在线| 亚洲一区免费网站| 欧美日韩色婷婷|