tags:

views:

404

answers:

3

I've asked this somewhere else, but the people there don't seem to understand what I am talking about.

When I go to the PECL website, all extensions found there are inside TGZ files.
Which is not a problem, any modern archiving program can open it.

Inside is always a .tar file and inside that are the source files. So, what do I do with that? I'm particularly interested in using the pecl_http extension, but I'm not sure what to do.

Note: there are no DLL files inside the .TAR files. None whatsoever, not a single one. All you find is C code and C headers.

+3  A: 

If there is not .dll provided, you have to compile it :-(

There was a pecl4win website some time ago, but it's down ; and the new http://windows.php.net/ does not have extensions on it yet (there is work going on, but windows is not the platform of choice for PHP developpers, nor core-developpers, so it's not going really fast).

You say this :

there are no DLL files inside the .TAR files. None whatsoever, not a single one. All you find is C code and C headers.

Which means you will have to compile the extension yourself :-( (maybe you'll get lucky, and find a .dll somewhere that fits your version of PHP ; some extensions, like Xdebug, have those on their official website, at least for recent versions of PHP... But it's not always the case :-( )

To compile a PECL extension with windows, you can take a look at these links :

Anyway... Good luck...

As a sidenote : if I remember correctly, the PHP's installer for windows has some PECL extensions bundled in ; maybe this one is one of those ?

Pascal MARTIN
Thanks for the links. I'm using WAMPserver, and it's strange to find how their version for 5.2.9-2 had 117 extensions, and their version for 5.3.0 has 31 extensions...
WebDevHobo
Things are improving on the Windows front, but you're absolutely right; It's still a second-rate os in the php-world.
troelskn
@WebDevHobo > I haven't installed PHP on windows for quite a while, but maybe it's because PHP 5.3 is still young (it's a ".0", after all), which might explain only a few extensions have been tested enough to be distributed by an "official" channel.@troelskn > indeed...One solution might be (if your computer is good enough) to have Apache+PHP in a Virtual Machine (using VMWare or VirtualBox), running Linux, and keep your IDE, browser, and everything else on your windows "real" machine... Better of the two worlds, as one would say ^^
Pascal MARTIN
+1  A: 

Plugins are almost always implemented using a shared library (a.k.a. dynamic library), containing functions which are dynamically loaded at runtime. On Windows, shared libraries are DLLs, which is why all the extensions (i.e. plugins) for PHP have come in the form of one or more DLL files. If you are given the source code for a plugin, you will need to build the source code (i.e., compile and link it) into a DLL or into DLLs.

How exactly you build the source code depends on the specific plugin. A well-designed source package will come with a "README" file explaining exactly how to build the the package. If the package contains a file named "configure" and another named "Makefile", then the build process is almost always to invoke:

./configure
make
sudo make install

On Windows, the commands above would have to be invoked using Cygwin. If the package contains a Visual Studio project file, then you can probably use that the build the source package.

Michael Aaron Safyan
+2  A: 

There ARE pecl library collections for Windows, and they're either appended (as a separate link) on PHP download page (named X.Y.Z-win32-pecl.zip or similar), or linked somehow (for example, the latest PHP5 can use PECL from the previous 5.X setup, and it says so on the download page).

If all You get is source code, You will need to build these yourself.

a) download PHP source code (a lot of headers required to build the libs and link them to PHP on Windows),

b) download the extensions You want to build, and put them in /phpsource/src/ext/ folder,

c) prepare Your favorite C/C++ IDE (I prefer to use VisualC++ 6.0 for the sole purpose of writing PHP extensions on Windows)

d) make a build environ, and finally

e) build ;-)

Do note You will need PHP[ver]debug_ts.lib or PHP[ver]release_ts.lib to link them properly.

Unless You're building them for PHP 4.4.4 (which I use to develop .exe apps using BamCompile - a roundabout way, but it works magic), in which case just send Your source code to me, I'll build it for You if I have time. ;-) Also chances are, the extension You're looking for HAS a .dll built for it already. Just take the name of the extension, and search Google for " php_*NameOfTheExtension*.dll PHP*YourPHPVersionNumber* " and You just might find it (although a few, like php_openAl.dll don't exist as .dll).

Egon_Freeman
Are you referring to this website: http://us2.php.net/get/pecl-5.2.6-Win32.zip/from/a/mirror ???
WebDevHobo