- Php amqp install windows
- Ответы (3)
- Для установки сделайте так:
- Php amqp install windows
- Фильтрация данных с помощью zend-filter
- Контекстное экранирование с помощью zend-escaper
- Подключение Zend модулей к Expressive
- Совет: отправка информации в Google Analytics через API
- Подборка PHP песочниц
- Совет: активация отображения всех ошибок в PHP
- Агент
- Php amqp install windows
- About
- How to install amqp on windows
- 5 Answers 5
- To install do like this:
- UPDATE
Php amqp install windows
2623 просмотра
3 ответа
У меня ошибка при установке pecl/amqp
когда я набираю в командной строке: pear install pecl/amqp
ВНИМАНИЕ: php_bin C: \ xampp \ php. \ Php.exe имеет суффикс. \ Php.exe,
Переменная config php_suffix не соответствует
ERROR: DSP amqp.dsp не существует.
Мне нужно установить это так, чтобы я мог использовать amqp ( RabbitMQ ) на php.
Ответы (3)
4 плюса
Примечание для пользователей Windows: это расширение в настоящее время не поддерживает Windows, поскольку библиотека librabbitmq еще не поддерживает Windows.
Но здесь, на сайте RabbitMQ, есть установщик Windows .
Видимо эта страница php.net устарела
Для установки сделайте так:
- Загрузите правильный пакет для вашего php с этой официальной страницы PECL amqp 1.4.0
- расстегнуть молнию
- добавить amqp.dll в ext папку php
- добавьте rabbitmq.1.dll в вашу папку Windows System 32.
Это согласно посту в блоге я нашел здесь
Автор: Wilt Размещён: 15.04.2015 11:53
1 плюс
Хотя это не ответит, как установить RabbitMQ с помощью груши, установив pecl / amqp, но вы когда-нибудь пытались использовать rabbitmq с чистой реализацией php php-amqplib ?
0 плюса
Это работает для меня в PHP 7.1 и amqp 1.9.4 для Windows.
Php amqp install windows
В этом разделе помещены уроки по PHP скриптам, которые Вы сможете использовать на своих ресурсах.
Фильтрация данных с помощью zend-filter
Когда речь идёт о безопасности веб-сайта, то фраза «фильтруйте всё, экранируйте всё» всегда будет актуальна. Сегодня поговорим о фильтрации данных.
Контекстное экранирование с помощью zend-escaper
Обеспечение безопасности веб-сайта — это не только защита от SQL инъекций, но и протекция от межсайтового скриптинга (XSS), межсайтовой подделки запросов (CSRF) и от других видов атак. В частности, вам нужно очень осторожно подходить к формированию HTML, CSS и JavaScript кода.
Подключение Zend модулей к Expressive
Expressive 2 поддерживает возможность подключения других ZF компонент по специальной схеме. Не всем нравится данное решение. В этой статье мы расскажем как улучшили процесс подключение нескольких модулей.
Совет: отправка информации в Google Analytics через API
Предположим, что вам необходимо отправить какую-то информацию в Google Analytics из серверного скрипта. Как это сделать. Ответ в этой заметке.
Подборка PHP песочниц
Подборка из нескольких видов PHP песочниц. На некоторых вы в режиме online сможете потестить свой код, но есть так же решения, которые можно внедрить на свой сайт.
Совет: активация отображения всех ошибок в PHP
При поднятии PHP проекта на новом рабочем окружении могут возникнуть ошибки отображение которых изначально скрыто базовыми настройками. Это можно исправить, прописав несколько команд.
Агент
PHP парсер юзер агента с поддержкой Laravel, работающий на базе библиотеки Mobile Detect.
Php amqp install windows
PHP AMQP bindings
Object-oriented PHP bindings for the AMQP C library (https://github.com/alanxz/rabbitmq-c)
- PHP >= 5.6 (PHP 7 included) with either ZTS or non-ZTS version.
- RabbitMQ C library, commonly known as librabbitmq (since php-amqp>=1.9.4 librabbitmq >= 0.7.1, see release notes).
- to run tests RabbitMQ server >= 3.4.0 required.
Some systems has php-amqp extension in their repo or available via external repositories, so it is MAY be the preferable way to install.
RPM packages are available in Fedora and EPEL (for RHEL and CentOS) official repositories, see php-pecl-amqp
Fresh php-pecl-amqp and librabbitmq RPMs available via remi repo.
If you want to stay on the bleeding edge and have the latest version, install php-amqp extension from PECL or compile from sources (follow PHP official docs instruction).
- Before download, check if your PHP installation is thread safe or non-thread safe by entering php -i|findstr «Thread» in your terminal
- Download thread safe or non-thread safe version of the extension for your PHP version from https://pecl.php.net/package/amqp. Look for the «DLL» link next to each release in the list of available releases
- After download, copy the rabbitmq.4.dll and rabbitmq.4.pdb files to the PHP root folder and copy php_amqp.dll and php_amqp.pdb files to PHP\ext folder
- Add extension=amqp to the php.ini file
- Check if the module is properly installed with php -m
There are also available stub files with accurate PHPDoc which may be also used in your IDE for code completion, navigation and documentation in-place.
Finally, check out the tests to see typical usage and edge cases.
Max channels per connection means how many concurrent channels per connection may be opened at the same time (this limit may be increased later to max AMQP protocol number — 65532 without any problem).
Nested header arrays may contain only string values.
You can’t share none of AMQP API objects (none of AMQPConnection , AMQPChannel , AMQPQueue , AMQPExchange ) between threads. You have to use separate connection and so on per thread.
- there may be only one persistent connection per unique credentials (login+password+host+port+vhost). If there will be an attempt to create another persistent connection with the same credentials, an exception will be thrown.
- channels on persistent connections are not persistent: they are destroyed between requests.
- heartbeats are limited to blocking calls only, so if there are no any operations on a connection or no active consumer set, connection may be closed by the broker as dead.
Developers note: alternatively for built-in persistent connection support raphf pecl extension may be used.
How to report a problem
- First, search through the closed issues and stackoverflow.com.
- Submit an issue with short and definitive title that describe your problem
- Provide platform info, PHP interpreter version, SAPI mode (cli, fpm, cgi, etc) extension is used in, php-amqp extension version, librabbitmq version, make tools version.
- Description should provide information on how to reproduce a problem (gist is the most preferable way to include large sources) in a definitive way. Use Vagrant to replicate unusual environments.
- If stack trace is generated, include it in full via gist or the important part (if you definitely know what you are doing) directly in the description.
Things to check before reporting a problem
Some of them, the list is not complete.
- You are running on correct machine in correct environment and your platform meets your application requirement.
- librabbimq is installed and discoverable in your environment so php-amqp extension can load it.
- php-amqp extension present in system (find amqp.so or amqp.dll if you are on windows), it is loaded ( php —ri amqp produced some info), and there are no underlying abstraction that MAY emulate php-amqp work.
- You hav correct RabbitMQ credentials.
- You are using the latest php-amqp, librabbitmq, RabbitMQ and sometimes PHP version itself. Sometimes your problem is already solved.
- Other extensions disabled (especially useful when PHP interpreter crashes and you get stack trace and segmentation fault).
There is a Vagrant environment with pre-installed software and libraries necessary to build, test and run the php-amqp extension.
To start it, just type vagrant up and then vagrant ssh in php-amqp directory.
Services available out of the box are:
- Apache2 — on 192.168.33.10:8080
- nginx — on 192.168.33.10:80
- RabbitMQ on 192.168.33.10:15672 with guest access (login: guest , password: guest )
Additional tools are pre-installed to make development process as simple as possible:
Valgrind is ready to help find memory-related problems if you export TEST_PHP_ARGS=-m before running tests.
phpbrew waits to help you to test extension on various PHP versions. phpbrew install 5.6 +debug+default+fpm is a nice start. To switch to some version just use phpbrew switch .
To start php-fpm just run phpbrew fpm start (don’t forget to run sudo service stop php5-fpm befor).
This development environment out of the box ready for php-fpm and cli extension usage, if need to test it when php used as apache module, refer to Apache2 support on phpbrew wiki. Keep in mind that +apxs2 conficts with +fpm and it is a bit tricky to specify which libphp .so will be loaded.
. TShark is able to detect, read and write the same capture files that are supported by Wireshark.
To use it you probably have to set network privileges for dumpcap first(see Platform-Specific information about capture privileges Wireshark docs page and running wireshark “Lua: Error during loading” SO question):
sudo setcap ‘CAP_NET_RAW+eip CAP_NET_ADMIN+eip’ /usr/bin/dumpcap
To start capturing, run tshark -i lo to see output in terminal or tshark -i lo -w capture.log to save capture and analyze it later (even with AMQP protocol Wireshark plugin). You may filter AMQP packages using -Y amqp attribute, just give a try — tshark -i lo -Y amqp .
NOTE: -w provides raw packet data, not text. If you want text output you need to redirect stdout (e.g. using ‘>’), don’t use the -w option for this.
Configuring a RabbitMQ server
If you need to tweek RabbitMQ server params use default config rabbitmq.config.example (raw) from official RabbitmMQ repo, so it may looks like sudo curl https://raw.githubusercontent.com/rabbitmq/rabbitmq-server/master/docs/rabbitmq.config.example /etc/rabbitmq/rabbitmq.config
To reset RabbitMQ application run in CLI (as privileged user) rabbitmqctl stop_app && rabbitmqctl reset && rabbitmqctl start_app .
Keeping track of the workers
It is a good practice to keep php processes (i.e workers/consumers) under control. Usually, system administrators write their own scripts which ask services about current status or performs some desired actions. Usually request is sent via UNIX signals.
Because amqp consume method is blocking, pcntl extension seems to be useless.
php-signal-handler extension uses signal syscall, so it will work even if blocking method was executed. Some use cases are presented on extension’s github page and examples are available here.
Rolling a release
Say we want to release «1.1000.0» next. We first run php tools/make-release.php 1.1000.0 . This will update the version numbers and pre-populate the changelog with the latest git commits between the previous version and now. It will prompt you to edit the changelog in between. Once the release is done it tells you what to do next. Run php tools/make-dev.php 1.1000.1 to bring master back into development mode afterwards.
About
PHP extension to communicate with any AMQP compliant server
How to install amqp on windows
I am having this error while installing pecl/amqp
when I type in the command line: pear install pecl/amqp
WARNING: php_bin C:\xampp\php.\php.exe appears to have a suffix .\php.exe,
config variable php_suffix does not match
ERROR: The DSP amqp.dsp does not exist.
I need to install this so that I can use amqp ( RabbitMQ ) on php.
5 Answers 5
Note to Windows users: This extension does not currently support Windows since the librabbitmq library does not yet support Windows.
But here at RabbitMQ website is a windows installer.
Apparently the information on the php.net page is outdated
To install do like this:
- Download the correct package for your php from this official PECL amqp page
- unzip
- add php_amqp.dll to your php ext folder and enable the extension inside your php.ini file: extension=php_amqp.dll
- add rabbitmq.#.dll to your windows system 32 folder (where # corresponds with the version number).
All this according to the post on the blog I found here.
UPDATE
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. 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.
- Download the correct package in https://pecl.php.net/package/amqp based on your PHP version, architecture, thread safety, and compiler. You can check it in phpinfo
- Copy php_amqp.dll to your php ext folder
- Update your php.ini with: extension=php_amqp.dll
- Copy rabbitmq.4.dll to your windows system 32 folder if 32bit system. add it to SysWOW64 if using 64bit system.
- Restart apache.
On Windows 10, build 19041 (2004 update), 64-bit.
Using Xampp with PHP 7.4.8.
- Go to here and download your relevant version: https://pecl.php.net/package/amqp (check which version you need in CLI using php -v )
- From the .zip , copy the rabbitmq.#.dll to C:/Windows/System32
- From the .zip , copy the php_amqp.dll to C:/xampp/php/ext (or simply your php/ext folder if using something else than Xampp)
If you’ve got PHP running as a service with Apache, restart Apache. If you’re using it via CLI (e.g. via Bash and/or Symfony CLI server) then you’re already good to go.
Other posts mention the 64-bit variant to have the rabbitmq.#.dll (where # is the version) to go in C:/Windows/SysWOW64 . I tried that, didn’t work for me, even though running 64-bit Windows and PHP.