Here is my dev setup:
IDE: PhpStorm 9.0.2
Debugger: Xdebug 2.3.3
Message Queue Server: RabbitMQ 3.5.6
PHP Lib to connect to RabbitMQ Server: php-ampqlib
To start my consumer I'm using a CakePHP Task and run like this:
../lib/Cake/Console/cake cron message_trigger_consumer
When I run this command, my consumer is UP and waiting for a message, that will comes from a Producer (for example: Save Form Button that send a confirmation email). Until here, everything is OK, but my two questions are:
1) Is There a way to debug the Consumer? In my point of view, Consumer is in a different process, that's why Xdebug cannot debug it
2) Have some way to attach my Consumer process to my current debug in PhpStorm + Xdebug?
If you not understand my question, please, show me your doubts.
You can find it in the extension window and install it. After installation, you must reload the VSCode window. Now, again run phpinfo(); method in any PHP file to check if Xdebug is enabled or not. Now click on the debug console tab and click on add configuration.
Google Dork Description: inurl:?XDEBUG_SESSION_START=phpstorm. Google Search: inurl:?XDEBUG_SESSION_START=phpstorm. #Google Dork : inurl:?XDEBUG_SESSION_START #Summary: Xdebug is a php extension that allows to debug php pages, remotely by using DGBp protocol. -
In Web Context Xdebugs Sessions are usually triggered by an Cookie named XDEBUG_SESSION
.
On The CLI there are no cookies, so you will have to tell xdebug to start a session by hand:
export PHP_IDE_CONFIG="serverName=your-server-name-configured-in-php-storm"
export XDEBUG_CONFIG="remote_host=ip_of_php_storm_pc idekey=PHPSTORM"
Then in PHP Storm just listen to incoming connections via the phone handset icon.
Its working great!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With