Webador / SlmQueue

Laminas / Mezzio module that integrates with various queue management systems.
Other
137 stars 56 forks source link

XDebug support writeup? #149

Closed EMCP closed 8 years ago

EMCP commented 9 years ago

I am now happily utilizing SlmQueue via Beanstalkd , with one problem.

XDebug is halting on regular calls made to my ZF2 application, but Queue'd Job code is not.. Any ideas why? Do I need to pass a flag on startup of the Queue Worker?

I'll be glad to write up more once I get it working. Does the Queue worker use /etc/php5/cli runtime?

/etc/php5/apache2/php.ini

zend.enable_gc = On
zend_extension=/usr/lib/php5/20121212/xdebug.so
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.remote_connect_back=1
xdebug.remote_host=10.10.10.1
xdebug.remote_port=9000
xdebug.idekey=PHPSTORM
juriansluiman commented 9 years ago

Does the Queue worker use /etc/php5/cli runtime?

If you invoke the worker with php public/index.php queue [....], yes you use the CLI runtime. Not sure why (if you configured the config correctly) the cli SAPI does not play nicely with XDebug, but tbh I have never used XDebug with the PHP cli :)

EMCP commented 9 years ago

I tried simply adding the above configuration to the cli php.ini , it merely complained that XDebug is already configured. I'll keep working on this and report back, thank you.

kusmierz commented 9 years ago

put this code into /usr/bin/xdebug:

#!/bin/bash
PHP_IDE_CONFIG="serverName=`echo $HOSTNAME`.cli" XDEBUG_CONFIG="idekey=xdebug" php -dxdebug.remote_autostart=1 -didekey=xdebug -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_host=`who am i | awk '{print $5}' | sed 's/[()]//g'` "$@"

next you can run xdebug public/index.php queue [...]. Good luck!

ltouro commented 9 years ago

my IDE starts XDebug with CLI like this C:\xampp\php\php.exe -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=127.0.0.1 index.php queue doctrine LtEmail\Queue\EmailQueue --start