NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
local debugger session


Joined: 02 Aug 2004
Posts: 5
Reply with quote
I just want to know if it is possible to debug a php script without web server, and without CGI module, just a php CLI utility.

to do this i have a little changed dbg.c
I just did a chk_argv_session() to check parameters passed to the php cli.

Code:

if (isreq == 0) isreq = chk_session_request(...);
if (isreq == 0) isreq = chk_argv_session(...);


It simply concat "SG(request_info).argv" with a separator ('&') and then call chk_session_request().

Look like it works. (DBG connect my client) but i'm asking if the DBG module is able to run in this mode without problems. Has somebody alredy tried this or know if there is some issus?
View user's profileFind all posts by GrayfoxSend private messageAIM AddressICQ Number
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
At the first glance, there should be no problems Smile
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 02 Aug 2004
Posts: 5
Reply with quote
Thank you. I will continue to work on it Wink
View user's profileFind all posts by GrayfoxSend private messageAIM AddressICQ Number


Joined: 14 Feb 2005
Posts: 5
Reply with quote
grayfox wrote:
I just want to know if it is possible to debug a php script without web server, and without CGI module, just a php CLI utility.

ddmitrie wrote:
At the first glance, there should be no problems Smile


Hello ddmitrie,
about debugging scripts with php cli (no cgi, no webserver):

I have been looking at some source codes (dbg, dbg-cli, sapi/cgi and sapi/cli), and with the help of the current thread I realize how
dbg-cli was setting up environment vars and calling the php binary through execve.

I might be missing something, but so far, I realized that this method doesn't work with php cli.
In DBG source I've found that chk_session_request_post() checks for DBGSESSID in the following php variables:

_POST, HTTP_POST_VARS, _COOKIE, and HTTP_COOKIE_VARS

But, AFAIK it's not possible to set any of those through command line arguments nor environment when using php cli (I guess only php-cgi incorporates the enviromnent variables), thus the DBG would't be activated.

Are the above thoughts correct?
If not, the procedure to debug using dbg-cli & php (cli) is the same documented??

Thanks in advance,
Thiago Silva
View user's profileFind all posts by tsilvaSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
it was fixed in 2.18.
Starting with this version it's possible to trigger debug session using DBGSESSID in the command line.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 14 Feb 2005
Posts: 5
Reply with quote
ddmitrie wrote:
it was fixed in 2.18.
Starting with this version it's possible to trigger debug session using DBGSESSID in the command line.


Thanks for the quick answer Smile
Is there a date for the open source release of this version?

Thanks again
Thiago
View user's profileFind all posts by tsilvaSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
Regarding version 2.18, we have no such plans.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 14 Feb 2005
Posts: 5
Reply with quote
ddmitrie wrote:
Regarding version 2.18, we have no such plans.


Sorry, I wrongly expressed myself (as I noticed there is a version 2.20).
I mean, when the next free version will be released?


Thiago
View user's profileFind all posts by tsilvaSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
I'm working on the free version in my free time and would not like to make any commitments. I can only say that it will happen soon. Probably in March.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 14 Feb 2005
Posts: 5
Reply with quote
Thanks!!
I appreciate your effort Very Happy
View user's profileFind all posts by tsilvaSend private message
local debugger session
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