NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
How to debug php cli code with dbg cli?


Joined: 27 Aug 2004
Posts: 2
Reply with quote
Hi!

I successfully installed dbg 2.11.26 and dbg-cli 2.11.0 on a linux machine, on which PHP-5.0.0RC3 with cli is installed. Running phpinfo() successfully returns dbg informations.

I would like to debug php code through the ~command-line~ php interpreter. Is it possible? And if yes, how?

Thanks for any answer.

Tourneur
View user's profileFind all posts by tourneurSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
see "set cgiexec" command through which you can set either php or php-cli as an executable to run and debug php script under dbg-cli.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 27 Aug 2004
Posts: 2
Reply with quote
Thanks for the answer.

Nevertheless, when I start the debugger, I still get a timeout.

The php.ini is set up as this:

extension=dbg.so

[Debugger]
debugger.enabled=on
debugger.profiler_enabled=on
debugger.JIT_enabled=true
debugger.JIT_host=clienthost
debugger.JIT_port=7869
debugger.JIT_level=4
debugger.fail_silently=false
debugger.ignore_nops=false
debugger.timeout_seconds=300
debugger.enable_session_cookie=true
debugger.session_nocache=on

I've written a simple php script that simply echoes some stuff, let's name it test_debugme.php. I launch the debugger and run the program and get the following result.

% dbg test.php
DBG php debugger, version 2.11.0, Copyright 2000, 2003, Dmitri Dmitrienko, www.nusphere.com/dbg
Reading symbols from /home/.../test_debugme.php...done.
dbg> run

Program exited.
Session start timeout has expired.
Program is not being run.
dbg>

I tried to set cgiexec to php

dbg> set cgiexec php

and checked the result with show

dbg> show cgiexec
/usr/local/bin/php.

I also tried to set the port to 7869 (I think I may be confusing this with http debugging...) with no result.

dbg> set port 7869

Furthermore, I get this result with `ps ax` after I triied to run:

30290 pts/6 S+ 0:00 dbg test_debugme.php
30291 pts/6 Z+ 0:00 [php] <defunct>

And each time a rerun, a new [php] <defunct> line is added. I finally get a lot of zombies that get killed when I exit the debugger. I don't know if this may help.

Tourneur.
View user's profileFind all posts by tourneurSend private message
How to debug php cli code with dbg cli?
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