[英]How to install amqp on windows
I am having this error while installing pecl/amqp
我在安装
pecl/amqp
时遇到这个错误
when I type in the command line: pear install pecl/amqp
当我在命令行中输入:
pear install pecl/amqp
WARNING: php_bin C:\\xampp\\php.\\php.exe appears to have a suffix .\\php.exe,
警告:php_bin C:\\xampp\\php.\\php.exe 似乎有一个后缀 .\\php.exe,
but但
config variable php_suffix does not match
配置变量 php_suffix 不匹配
ERROR: The DSP amqp.dsp does not exist.错误:DSP amqp.dsp 不存在。
I need to install this so that I can use amqp ( RabbitMQ
) on php.我需要安装它,以便我可以在 php 上使用 amqp (
RabbitMQ
)。
@ AMQP installation php.net : @AMQP 安装 php.net :
Note to Windows users: This extension does not currently support Windows since the librabbitmq library does not yet support Windows.
Windows 用户注意:此扩展目前不支持 Windows,因为 librabbitmq 库尚不支持 Windows。
But here at RabbitMQ website is a windows installer...但是在 RabbitMQ 网站上有一个 Windows 安装程序...
Apparently the information on the php.net page is outdated显然php.net页面上的信息已过时
php_amqp.dll
to your php ext
folder and enable the extension inside your php.ini file: extension=php_amqp.dll
php_amqp.dll
添加到你的 php ext
文件夹并在你的 php.ini 文件中启用扩展: extension=php_amqp.dll
rabbitmq.#.dll
to your windows system 32 folder (where # corresponds with the version number).rabbitmq.#.dll
添加到您的 Windows 系统 32 文件夹(其中 # 对应于版本号)。 All this according to the post on the blog I found here .所有这一切都根据我在这里找到的博客上的帖子。
I updated some of the information above.我更新了上面的一些信息。 The blog post is from 2013, and only mentioning older versions, but it is anyway a nice guide to the steps you need to take.
这篇博文是 2013 年的,只提到了旧版本,但无论如何它是您需要采取的步骤的一个很好的指南。 Since then newer versions are available so be aware there are some slight differences in the process (mainly version numbers) if you want to install a newer version.
从那时起,可以使用更新的版本,因此如果您想安装更新的版本,请注意过程中存在一些细微的差异(主要是版本号)。
This works for me in PHP 7.1, and amqp 1.9.4 for Windows.这适用于 PHP 7.1 和 amqp 1.9.4 适用于 Windows。
On Windows 10, build 19041 (2004 update), 64-bit.在 Windows 10 上,内部版本 19041(2004 更新),64 位。
Using Xampp with PHP 7.4.8.在 PHP 7.4.8 中使用 Xampp。
php -v
)php -v
在 CLI 中检查您需要哪个版本).zip
, copy the rabbitmq.#.dll
to C:/Windows/System32
.zip
,将rabbitmq.#.dll
复制到C:/Windows/System32
.zip
, copy the php_amqp.dll
to C:/xampp/php/ext
(or simply your php/ext
folder if using something else than Xampp).zip
,将php_amqp.dll
复制到C:/xampp/php/ext
(或者如果使用 Xampp 以外的其他东西,则只是你的php/ext
文件夹) If you've got PHP running as a service with Apache, restart Apache.如果您已将 PHP 作为服务与 Apache 一起运行,请重新启动 Apache。 If you're using it via CLI (eg via Bash and/or Symfony CLI server) then you're already good to go.
如果您通过 CLI(例如通过 Bash 和/或 Symfony CLI 服务器)使用它,那么您已经可以开始使用了。
Other posts mention the 64-bit variant to have the rabbitmq.#.dll
(where #
is the version) to go in C:/Windows/SysWOW64
.其他帖子提到 64 位变体让
rabbitmq.#.dll
(其中#
是版本)进入C:/Windows/SysWOW64
。 I tried that, didn't work for me, even though running 64-bit Windows and PHP.我试过了,对我不起作用,即使运行 64 位 Windows 和 PHP。
$ php -v
PHP 7.4.8 (cli) (built: Jul 9 2020 11:30:39) ( ZTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
虽然这不会回答如何使用 pear install pecl/amqp 安装 RabbitMQ,但是您是否尝试过将 rabbitmq 与纯 php 实现php-amqplib 一起使用?
After many hours of search: To install amqp to php7.4 & Windows 10 ( https://pecl.php.net/package/amqp ),经过数小时的搜索:将 amqp 安装到 php7.4 和 Windows 10 ( https://pecl.php.net/package/amqp ),
Choose the good file (x86,x64,ts,nts)选择好的文件 (x86,x64,ts,nts)
php -i or phpinfo() (Architecture => x64) php -i 或 phpinfo()(架构 => x64)
php -i|findstr "Thread" (ts or nts enable) php -i|findstr "Thread" (ts 或 nts 启用)
Copy复制
rabbitmq.4.dll and rabbitmq.4.pdb files to PHP root folder rabbitmq.4.dll 和 rabbitmq.4.pdb 文件到 PHP 根文件夹
php_amqp.dll and php_amqp.pdb files to PHP\\ext folder php_amqp.dll 和 php_amqp.pdb 文件到 PHP\\ext 文件夹
Add extension=amqp to the php.ini file在 php.ini 文件中添加 extension=amqp
check php -m if you show amqp (php -v to show errors)检查 php -m 如果你显示 amqp (php -v 显示错误)
If you are on Windows
, on this Url you can download the installable rabbitmq
and here is the direct download link for RabbitMQ 3.9.11 .如果您使用的是
Windows
,您可以在此 URL上下载可安装的rabbitmq
,这里是RabbitMQ 3.9.11的直接下载链接。
You can also use choco
to install it using:您还可以使用
choco
来安装它:
choco install rabbitmq
And since, rabbitmq
is implemented/written in erlang you also need erlang
to be able to install rabbitmq
and its services.由于
rabbitmq
是用erlang实现/编写的,因此您还需要erlang
才能安装rabbitmq
及其服务。 Make sure you download erlang
and install it.确保下载
erlang
并安装它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.