views:

1331

answers:

3

I am using a Windows XP Home Edition. I need to install a few extensions to PHP -- memcache, APC, .etc. And I would very much like to use PECL to make this happen. The problem is PECL takes it for granted that I will have certain programs on my computer. On another post, I read, for instance, that you need to have Microsoft Visual Studio C++ installed on your machine. However, the new version of Visual Studio, which I downloaded, does not have msdev.exe and instead uses vcbuild.exe, which has a completely different api and fails to compile the .dsp files that come with these modules.

So I tried to find a script that would upgrade the dsp to work with vcbuild.exe...and it turns out vcbuild.exe can do that, but of course that didn't pan out.

Another thing I tried was to find a make script for Windows (nmake2make). But there was no make file in the module's root folder.

I tried also downloading Cygwin and MinGW in hopes of finding a build script that would work as simply as in *nix operating systems, but to no avail.

How else do I use install PHP extensions on a Windows machine? Can anyone help me out of this predicament?

+3  A: 

Are you trying to compile the PECL extensions? If so than I cannot help.

But if you just want to install some PECL extensions on your windows box, than it should not be harder than installing any other PHP extensions. Go to http://pecl4win.php.net/ for Windows specific PECL extensions, copy your extensions to the /ext/ directory in your PHP installation directory (or where you put your extensions) and enable the extension from php.ini:

extension=php_apc.dll

Restart your web server instance and you are ready to go.

Alexandru Luchian
I can't believe it was that easy. Initially, I had used this commandpecl install imagick...and the error from that made want to compile it. But I didn't realize there were precompiled extensions. Thank you. I suppose it's not possible to compile your own extensions on a Windows machine then?
picardo
Frankly I never compiled php extensions on a Windows box, but it is possible.But I don't see the point (unless you want to see how it works or if you wrote your own modules).I tried a couple of times to write a basic extension (was on Linux), I used phpize which eases the development/deployment.
Alexandru Luchian
A: 

The only way I can think of is: manually. Yeah, I know, but this is pretty easy comparatively.

If you have the compiler, then you can at least compile an extension if you have the source. Otherwise you're stuck with trying to locate a binary distribution (like me).

Here's what you do, from what I understand:

  1. Put the extension library folder under PHP's install path. On my computer this is C:\xampp\php\ext. Search in your PHP.ini for "extension_dir" to find what yours is.
  2. Edit php.ini to load the extension.
    1. Find ; Dynamic Extensions ;.
    2. Add line extension=my_lib.dll

This should do it. Otherwise you should probably search for an in-depth guide on manual installation.

The Wicked Flea
A: 

For memcache you will need the memcache server located here -> http://code.jellycan.com/memcached/ and download the win32 binary

Never used APC :P I use eAccelerator0953_5.2.6 to cache the code

AntonioCS