如何在 WAMP 上本地安装 PHP 扩展?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6803265/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to install PHP extension locally on WAMP?
提问by anna
I've never done this, so I'm looking for detailed guidance. I'm trying to use the Evernote API to create a PHP page. I've downloaded their SDK and it says I need to install OAuth extension for PHP. I have WAMPSERVER installed on my local machine (Windows 7). I've tried reading the manual but I can't even figure out what to download :S Is this a fairly straightforward process?
我从来没有这样做过,所以我正在寻找详细的指导。我正在尝试使用 Evernote API 创建一个 PHP 页面。我已经下载了他们的 SDK,它说我需要为 PHP 安装 OAuth 扩展。我在本地机器(Windows 7)上安装了 WAMPSERVER。我试过阅读手册,但我什至不知道要下载什么 :S 这是一个相当简单的过程吗?
回答by plague
Get the precompiled dll from http://downloads.php.net/pierre/
从http://downloads.php.net/pierre/获取预编译的 dll
Search the page for oauthand choose the one for your machine.
在页面上搜索oauth并为您的机器选择一个。
Put that .dll file in your PHP extensions directory. Find the extensions area in your php.ini file and add this to it:
将该 .dll 文件放在您的 PHP 扩展目录中。在 php.ini 文件中找到扩展区域并将其添加到其中:
[PHP_OAUTH]
extension=php_oauth.dll
[PHP_OAUTH]
扩展名=php_oauth.dll
restart WAMP server
重启 WAMP 服务器
回答by Corey Larson
The PHP site gives great instructions on how to install PHP extensions on Windows. Just Find the *.dll in the PECL, and follow these instructions. You can get the OAuth library here.
PHP 站点提供了有关如何在 Windows 上安装 PHP 扩展的详细说明。只需在 PECL 中找到 *.dll,然后按照这些说明进行操作。您可以在此处获取 OAuth 库。
回答by Mored1984
I'm using WAMPServer (x64) with PHP5.6.25 & I want to install "Blesta", the requirements need "Pecl - Mailparse", So:
我正在使用 WAMPServer (x64) 和 PHP5.6.25 & 我想安装“Blesta”,要求需要“Pecl - Mailparse”,所以:
- I download "PHP Mailparse v2.1.6 (PHP v5.6)(Thread Safe)(vc11)(x64)"
- I extract the download file in "C:\wamp64\bin\php\php5.6.25\ext" folder
- I add "extension=php_mailparse.dll" to file "C:\wamp64\bin\php\php5.6.25\phpForApache.ini" but at the end of "Dynamic Extensions"
- Restart the WAMPServer
- Install "Blesta"
- 我下载“PHP Mailparse v2.1.6 (PHP v5.6)(Thread Safe)(vc11)(x64)”
- 我在“C:\wamp64\bin\php\php5.6.25\ext”文件夹中解压下载文件
- 我将“extension=php_mailparse.dll”添加到文件“C:\wamp64\bin\php\php5.6.25\phpForApache.ini”但在“Dynamic Extensions”的末尾
- 重启 WAMPServer
- 安装“Blesta”
Note for #3 Example:
#3 示例的注释:
;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
extension=php_openssl.dll
;extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_shmop.dll
extension=php_mailparse.dll
回答by Robert Duchnik
I had the same issues trying to set this up myself. A lot of the information on stackoverflow on this subject is good but outdated. You can get the latest oAuth libraries on the php.net site here now:
我在尝试自己设置时遇到了同样的问题。很多关于这个主题的 stackoverflow 的信息都很好,但已经过时了。您现在可以在 php.net 站点上获取最新的 oAuth 库:
http://windows.php.net/downloads/pecl/releases/oauth/
http://windows.php.net/downloads/pecl/releases/oauth/
However, I also had some issues getting it to work with WAMP since the version of PHP they provided was out of date and didn't work with the extensions there. To fix this I had to manually add php versions to WAMP. You can follow this guide on how to do that:
但是,我在使用 WAMP 时也遇到了一些问题,因为他们提供的 PHP 版本已经过时并且无法与那里的扩展一起使用。为了解决这个问题,我必须手动将 php 版本添加到 WAMP。您可以按照本指南了解如何执行此操作:
http://www.websanova.com/tutorials/php/manually-adding-php-versions-to-wamp
http://www.websanova.com/tutorials/php/manually-adding-php-versions-to-wamp