phpwindowsphp-extensionpeclgearman

How to install Gearman PHP extension on Windows?


Background:
1. How can i install gearman php extension on Windows OS?
2. Installing gearman PHP extension on Windows using cygwin and pecl

Following the answer in 1. question, I've made my cygwin work, downloaded and compiled gearman, and got the first gearman worker example to work:

enter image description here

Problem:
To run the same example from PHP script, I still need PHP extension. Somewhere I've seen that I might get to install PECL extension using PEAR, so:

  1. I've downloaded go-pear.phar into C:\...\php5.6.16
  2. ran php go-pear.phar
  3. installed PEAR in system mode -> success

Now I can do: C:\...\php5.6.16>pecl install gearman which gives:

WARNING: channel "pecl.php.net" has updated its protocols, use "pecl         
channel-update pecl.php.net" to update
downloading gearman-1.1.2.tgz ...
Starting to download gearman-1.1.2.tgz (30,961 bytes)
.........done: 30,961 bytes
3 source files, building
ERROR: The DSP gearman.dsp does not exist.

Which would indeed be a sorcery if it worked, as that extension should be probably built/compiled accordingly to PHP itself. What is the least painful way to make this work? Is there a way how to do this without installing Visual Studio? I've also seen Net_Gearman PEAR package that might perhaps be wrapped / tweaked to be used just as the PECL one?

I'm currently using WAMP3.1.1 with PHP5.6.16 it comes with + VC15 x64 Thread Safe PHP7.2.2, need Gearman to work with at least one of those two. Any help appreciated


Solution

  • I've followed these 2 guides:

    1. I've downloaded:

    • Visual Studio 2012
    • .NET Framework 4.7.1 (which at the end just flashed a message that it's already installed)
    • Windows SDK _X_EN_DVD.iso
    • php-sdk-binary-tools-20110915.zip
    • deps-5.6-vc11-x64.7z (dependencies)
    • php-src-php-5.6.16.zip (GitHub release)

    2. Compiled PHP

    • (note this is all from Native Tools Command Prompt, I didn't even actually start VS at all)
    • used just configure --disable-all --enable-cli --enable-pdo

    3. Tried to compile PECL Gearman

    4. Found Gearman wrapper for Windows:

    mhlavac/gearman on GitHub