简体   繁体   English

在Windows上安装PHP扩展

[英]Installing PHP extensions on Windows

I am using a Windows XP Home Edition. 我使用的是Windows XP Home Edition。 I need to install a few extensions to PHP -- memcache, APC, .etc. 我需要为PHP安装一些扩展 - memcache,APC,.etc。 And I would very much like to use PECL to make this happen. 而且我非常希望使用PECL来实现这一目标。 The problem is PECL takes it for granted that I will have certain programs on my computer. 问题是PECL理所当然地认为我的计算机上会有某些程序。 On another post, I read, for instance, that you need to have Microsoft Visual Studio C++ installed on your machine. 在另一篇文章中,我读到,例如,您需要在您的计算机上安装Microsoft Visual Studio C ++。 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. 但是,我下载的新版Visual Studio没有msdev.exe,而是使用vcbuild.exe,它具有完全不同的api,无法编译这些模块附带的.dsp文件。

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. 所以我试图找到一个可以升级dsp以使用vcbuild.exe的脚本......事实证明vcbuild.exe可以做到这一点,但当然这并没有成功。

Another thing I tried was to find a make script for Windows (nmake2make). 我尝试的另一件事是为Windows找到一个make脚本(nmake2make)。 But there was no make file in the module's root folder. 但模块的根文件夹中没有make文件。

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. 我还尝试下载Cygwin和MinGW,希望找到一个像* nix操作系统一样简单的构建脚本,但无济于事。

How else do I use install PHP extensions on a Windows machine? 我如何在Windows机器上使用安装PHP扩展? Can anyone help me out of this predicament? 任何人都可以帮助我摆脱这种困境吗?

For all peoples coming here to download the dll extension files. 对于所有来这里的人来下载dll扩展文件。

This is the link to the PHP extension download link http://windows.php.net/download/ 这是PHP扩展下载链接http://windows.php.net/download/的链接

And this is a list of PHP extensions to download: http://pecl.php.net/package-search.php 这是一个可下载的PHP扩展列表: http//pecl.php.net/package-search.php

For core extensions, or if you cant find any on pecl.php.net, download PHP from a zip http://windows.php.net/download/ and look inside of /ext and copy them to your local php /ext folder. 对于核心扩展,或者如果你无法在pecl.php.net上找到任何内容,请从zip下载PHP http://windows.php.net/download/并查看/ ext内部并将它们复制到本地php / ext文件夹。

For memcache you will need the memcache server located here -> http://code.jellycan.com/memcached/ and download the win32 binary 对于memcache,你需要位于这里的memcache服务器 - > http://code.jellycan.com/memcached/并下载win32二进制文件

Never used APC :PI use eAccelerator0953_5.2.6 to cache the code 从未使用过APC:PI使用eAccelerator0953_5.2.6来缓存代码

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. 将扩展库文件夹放在PHP的安装路径下。 On my computer this is C:\\xampp\\php\\ext . 在我的电脑上,这是C:\\xampp\\php\\ext Search in your PHP.ini for "extension_dir" to find what yours is. 在PHP.ini中搜索“extension_dir”以查找您的内容。
  2. Edit php.ini to load the extension. 编辑php.ini以加载扩展名。
    1. Find ; Dynamic Extensions ; ; Dynamic Extensions ; ; Dynamic Extensions ; .
    2. Add line extension=my_lib.dll 添加行extension=my_lib.dll

This should do it. 这应该做到这一点。 Otherwise you should probably search for an in-depth guide on manual installation. 否则,您应该搜索有关手动安装的深入指南。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM