NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
How to Debug Laravel Queues ?


Joined: 02 Dec 2013
Posts: 10
Reply with quote
I'm really struggling with this. I cannot figure out how to start a PhpED debugging session with queues in Laravel and trigger a breakpoint in my scripts. Any hints would be gratefully received.
View user's profileFind all posts by robdlyonSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
By looking at your post I can't figure out what's wrong.
Can you provide more details? In particular -- what you're trying, precisely, and what you're getting?
Normally running debugger is not a big deal -- it's just matter of having DBGSESSID variable either in _COOKIE, _GET or _POST, or invoking DebugBreak() function.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
debugging queues from CLI


Joined: 30 May 2006
Posts: 93
Reply with quote
@robdlyon

I assume you are trying to debug from command line (CLI).

We succeeded to run debug session with RabbitMQ in Yii2 framework like so:

1/
run CLI command with normal CLI parameters passed to entry script, e.g. in yii it would be:

./yii queues/send-emails --maxcount=15 DBGSESSID=123456789@192.168.0.111:7869

Important part is "DBGSESSID=123456789@192.168.0.111:7869" which tells server to start debug session - it's also described in PHPEd's documentation online, pls check.

2/
Since this is CLI command, PHP loads different php.ini than when processing HTTP request via web server.
So make sure php.ini loaded via CLI also loads correct version of DBG module.
See also this thread on dumping CLI phpinfo:
https://stackoverflow.com/questions/8954964/how-to-set-error-log-for-php-cli/30823469#30823469

3/
Once debug session started, you may set breakpoints inside e.g. queue callback function - it will work normally.
I am not sure whether laravel will correctly pass CLI arguments, for example PHPUnit can not (cannot start debug session via CLI in PHPUnit - at least versions bellow 5)
View user's profileFind all posts by lubosdzSend private message
Guru master

Joined: 24 Jul 2009
Posts: 737
Reply with quote
You can also use DebugBreak in your code. I often wrap that with a suitable check to ensure a DebubBreak cannot be accidentally used in production:

Code:
if ($isDebug) {
    DebugBreak('1@192.168.0.111');
}


You can optionally use all of the normal DBGSESSID parameters on the end of the string, such as for starting profiler, etc.
View user's profileFind all posts by plugnplaySend private message
How to Debug Laravel Queues ?
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic