Rapid PHP 2015 + Console Debugging

Post your questions and problem reports here

Moderator: kfury77

Forum rules
Please try to follow these guidelines. This will help to receive faster and more accurate response.

  • Check the Support section of the corresponding product first. Chances are you will find your answer there;
  • Do not create new topics for already reported problems. Add your comments to the existing topics instead;
  • Create separate topic for each problem request. Do NOT post a number of non-related problem reports in a single topic;
  • Give your topic a meaningful title. Titles such as "A question," "Bug report" and "Help!" provide others no clue what your message is about;
  • Include the version number of the software you are using;
  • This is not an official customer support helpdesk. If you need a prompt and official response, please contact our support team directly instead. It may take a while until you receive a reply in the forum;

Rapid PHP 2015 + Console Debugging

Postby danheskett » Wed May 27, 2015 11:19 pm

I have successfully setup PHP + XDebug + Rapid PHP 2015 and it works fine to debug scripts that execute within the context of a single page. I am using PHP 5.4.7 and the internal webserver.

I have two scenarios that I can't seem to get to work for debugging, they are:

1. Script #1 executes and creates a form, user submits form to Script #2. How can I catch the $_POST from #1 to #2, and debug from the start of script #2? Is this supported with my webserver, or do I need a real standalone webserver?

2. Many of the scripts I am working with are executed from the console of a windows or linux box without being executed through CGI of a webserver. In this case, parameters are passed through the $argv superglobal. Is there any way to use Rapid PHP to debug this type of scenario? I tried using the Arguments parameter in the Debugger configuration window, but they do not seem to pass into the script, the script dies with undefined errors for $argv. I believe the script is being executed through CGI and not through the consolse version of PHP.

Thanks in advance.
danheskett
 
Posts: 2
Joined: Wed May 27, 2015 11:12 pm

Re: Rapid PHP 2015 + Console Debugging

Postby Aivars » Thu May 28, 2015 11:07 am

1. It can be done as you expect it, by adding a breakpoint to Script #2 but due to a bug that we are aware of but haven't been able to fix yet, for some reason the breakpoint won't work in the first line of the code, so add the breakpoint to the first and second line (that contains some code statement). It works with the built-in webserver, I just tested, just make sure Listen to external sessions checkbox is on (it's on by default).

2. Script is always debugged as cgi. One idea would be to use a wrapper script that sets up $argv global and then calls the script to debug.
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 2453
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: Rapid PHP 2015 + Console Debugging

Postby danheskett » Wed Jun 03, 2015 5:39 am

Thanks for your reply.

#1 - Yes, this is what I was finding, I was literally trying to set the break point on Script #2. So that resolved it perfectly.

#2 - I understand, I think I can make that workaround happen correctly. Thanks for that. I have found that I can create a library block that has a conditional that detects what mode the script is being executed as (CGI vs. console) and then get the parameters appropriately that way.

I have another question, related, about debugging:

The built-in webserver works great for me for most debugging, and most development. And I also have a the Preview function working correctly for me to be able to Preview scripts that are executing on a remote webserver, by using the Mappings function.

However, is it possible to use Rapid PHP with a really remote Apache webserver + PHP +XDebug, so that I can tap into my existing development environment? For smaller projects that are borderline trivial the built-in webserver plus local PHP+XDebug is fine, but for larger projects, I have found the process of making the application run on my development PC that executes Rapid PHP tedious and often more trouble than it's worth.

Thanks in advance.
danheskett
 
Posts: 2
Joined: Wed May 27, 2015 11:12 pm

Re: Rapid PHP 2015 + Console Debugging

Postby Aivars » Wed Jun 03, 2015 11:14 am

The way PHP debugger works is that it connects to localhost:9000 and sends the required data. Any IDE (such as WeBuilder) has an opportunity to listen to the port 9000 and receive the debugging information. So for remote debugging you need to force the remote host to connect to to your development computer instead of localhost and I think the only reasonable way to do it is via some sort of ssh tunnel. Setting it all up might be way more trouble than making the projects run locally - plus if you run them locally you don't need to be afraid from breaking things as you would on the production server.
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 2453
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia


Return to HTMLPad / Rapid CSS / Rapid PHP / WeBuilder Support

Who is online

Users browsing this forum: No registered users and 11 guests