Problem installing for PHP in Windows

534 views
Skip to first unread message

Pedro Moreira

unread,
Aug 26, 2014, 2:16:19 PM8/26/14
to rabbitm...@googlegroups.com
Hi,

I'm trying to install RabbitMQ for PHP to use in Laravel framework.

So, it seems that RabbitMQ is running fine. I've created a queue already.

Now, to make it work with Laravel, I've installed this in my project:
https://github.com/fintech-fab/laravel-queue-rabbitmq

When it tries to load these constants, it says the constant is not defined:
AMQP_EX_TYPE_DIRECT and AMQP_DURABLE

If I comment out the lines where they are requested, it gives me this error:
Class 'AMQPConnection' not found

So, I guess there is a missing link here.

Alvaro Videla

unread,
Aug 26, 2014, 2:21:36 PM8/26/14
to Pedro Moreira, rabbitm...@googlegroups.com
Hi,

In order to have those constants defined, you need to install the PECL AMQP extension:


Regards,

Alvaro


--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bogdan Padalko

unread,
Aug 26, 2014, 2:32:01 PM8/26/14
to Alvaro Videla, Pedro Moreira, rabbitm...@googlegroups.com
I would recommend to use fresh version of php-amqp extension - http://pecl.php.net/package/amqp/1.4.0/windows


On Tue, Aug 26, 2014 at 9:21 PM, Alvaro Videla <videl...@gmail.com> wrote:
Hi,

In order to have those constants defined, you need to install the PECL AMQP extension:


Regards,

Alvaro


--
Regards,
Bogdan Padalko

Pedro Moreira

unread,
Aug 27, 2014, 6:00:17 AM8/27/14
to rabbitm...@googlegroups.com
So, I've installed it and commented out where those constants are called to be able to run composer update.
Then, after uncommenting them, when I call Mail::queue() in the framework, it inserts the message in the queue! Yay!

But now I must do php artisan queue:listen in order to start the queue listener.
When I do, it gives me this error:

{"error":{"type":"ErrorException","message":"Use of undefined constant AMQP_EX_TYPE_DIRECT - assumed 'AMQP_EX_TYPE_DIRECT'","file":"C:\\Ampps\\www\\actividades2\\app\\config\\queue.php","line":84}}{"error":{"type":"ErrorException","message":"Use of undefined constant AMQP_EX_TYPE_DIRECT - assumed 'AMQP_EX_TYPE_DIRECT'","file":"C:\\Ampps\\www\\actividades2\\app\\config\\queue.php","line":84}}{"error":{"type":"ErrorException","message":"Use of undefined constant AMQP_EX_TYPE_DIRECT - assumed 'AMQP_EX_TYPE_DIRECT'","file":"C:\\Ampps\\www\\actividades2\\app\\config\\queue.php","line":84}}

Also, if I run composer update, it still gives me those same errors.

I've installed the PECL AMQP extension this way:
  • Since in my phpinfo() says the architecture is x86 and Thread Safety is enabled, I've downloaded the 1.4.0 DLL.
  • Copied rabbitmq.1.dll to C:\Windows\SysWOW64 since the system is x64
  • Copied php_amqp.dll to php/ext.
  • Added extension=php_amqp.dll to apache/php.ini.
Thanks for your help!

Pedro Moreira

unread,
Aug 27, 2014, 6:02:57 AM8/27/14
to rabbitm...@googlegroups.com
Correction:
  • Since in my phpinfo() says the architecture is x86 and Thread Safety is enabled, I've downloaded the 1.4.0 DLL for PHP 5.5 Thread Safe (TS) x86.

Alvaro Videla

unread,
Aug 27, 2014, 8:01:26 AM8/27/14
to Pedro Moreira, rabbitm...@googlegroups.com
Does phpinfo() report that the extension is loaded?


On Wed, Aug 27, 2014 at 12:02 PM, Pedro Moreira <screen.dese...@gmail.com> wrote:
Correction:
  • Since in my phpinfo() says the architecture is x86 and Thread Safety is enabled, I've downloaded the 1.4.0 DLL for PHP 5.5 Thread Safe (TS) x86.

--

Bogdan Padalko

unread,
Aug 27, 2014, 12:26:44 PM8/27/14
to rabbitm...@googlegroups.com
Here is a good walk-through to figure out the exact problem - https://github.com/pdezwart/php-amqp#how-to-report-a-problem. Looks like php-amp extension is not installed or not loaded. Make sure it installed and proper config file used (note, that often there are separare ini file for fpm and cli mode).

Pedro Moreira

unread,
Aug 28, 2014, 12:26:54 PM8/28/14
to rabbitm...@googlegroups.com
The problem is solved.
For reference, check here:
Reply all
Reply to author
Forward
0 new messages