18

I found a few related posts here but didn't get my answer. So posting again.
How would I install a PECL extension on windows? Say I want the PECL oAuth extension on Windows XP.
I know 2 methods, but none of them is working for me.

  1. The site http://pecl4win.php.net/ is down for months. So I cant download the DLL. Is there any place we can download the DLLs from ?

  2. running the command pecl install oauth-0.99.9.tgz is throwing the error
    The DSP oauth.dsp does not exist.
    I tried with few other extensions also and getting the same error.

What am I missing here?

6 Answers 6

19

Releases can now be found here:
http://windows.php.net/downloads/pecl/releases/

If you need an extension not available there you might ask on the pecl-dev at lists.php.net mailing list.

3
  • 1
    Since source of the extensions is easily available, instead of directly providing a specific dll, it would be better if you publish a detailed guide on how to a build a pecl extension dll from the source. I found a few articles on this but still not very clear.
    – Varun
    Jan 15, 2010 at 14:03
  • 3
    wiki.php.net/internals/windows/stepbystepbuild has some instructions. As I said in a comment to another answer here: The build system on windows currentlydoesn't allow building extensions stand-alone, but oyu have to build from the PHP source tree. For adding oauth you either have to put the sources under php-src/ext/oauth before running buildconf.bat or use the --extra-ext-dir (or similar) option for buildconf.bat.
    – johannes
    Jan 16, 2010 at 15:16
  • Two years later an update to my previous comment: Meanwhile there is a "phpize" tool similar to the Unix one available from binary "development" downloads. Building PECL extensions often still isn't trivial as many developers don't test on windows, which needs some adoptions, especially when using 3rd party libraries
    – johannes
    May 15, 2012 at 13:31
3

I got what I am looking for in http://windows.php.net/downloads/pecl/releases/

2

Currently PECL for windows is in an odd reformation state. The reason being that I believe they are trying to provide VS2008 source versions. I would actually suggest using Zend Server for now until the windows half of the php group gets everything fixed up. Zend Server includes almost all of the extensions that you can find in PECL, and everything else, if you are lucky, you could find an compile yourself.

2
  • So can we say that Zend is doing this on purpose for some possible future monetary gains?
    – Pacerier
    Oct 26, 2014 at 18:56
  • @Pacerier Zend doesn't own PHP, PHP uses the Zend Engine. The windows php group is an open source group. That said, Zend Server is an enterprise solution from Zend, for monetary gain. Which is probably why they added the most common modules to Zend Server for windows.
    – Kevin Peno
    Oct 30, 2014 at 19:43
1

The PECL installer downloads the source code of the extension and tries to compile it with your local C compiler. The problem is that the whole process is designed for Unix systems, where a C compiler is available or can be easily installed. Setting an environment to compile C code under Windows is pretty complicate.

The ideal solution is getting a DLL file that someone already compiled. That's what the pcle4win site was for. However, there's currently no official repository to download PECL DLLs so you only have two alternatives:

It'd be cool that there was a DLL repository out there but I'm unaware of any.

1

The php source ships with a set of configuration scripts for windows (using windows script host) that mimics the autoconf tools as far as php is concerned. If you place the code for the extension in a directory under the /ext directory (where all the other extensions like bcmath, bzip, ... are located) you can let the buildconf-script create a makefile that includes the build rules for that (new) extension.
There's a step-by-step walk-through at http://wiki.php.net/internals/windows/stepbystepbuild which seems to be brief but feasible.

2
  • 1
    You're talking Unix not Windows. building extensions stand-alone without building all of PHP on windows is not possible.
    – johannes
    Jan 12, 2010 at 18:32
  • Yes, I was intentionally vague by saying "create a makefile that includes the build rules". So what? Build the core and just the extension you want as a shared module, make sure the config parameters match those of php package you're using and then use the .dll with your "regular" php installation. Could be easier, but it's not rocket science, is it? The mailparse extension doesn't even depend on external libraries.
    – VolkerK
    Jan 12, 2010 at 20:48
1

compiled oauth: http://windows.php.net/downloads/pecl/releases/oauth/

another pecl extension: http://windows.php.net/downloads/pecl/releases/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.