Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » Using Xdebug to step through php script on webserver(how can I do it?)
icon5.gif  Using Xdebug to step through php script on webserver [message #508251] Mon, 18 January 2010 06:08 Go to next message
Ethereal1m Mising name is currently offline Ethereal1m Mising nameFriend
Messages: 37
Registered: January 2010
Member
Dear experts,
I try to step through php script that is running on a webserver. I set the debug configuration by setting the web server, the script, and set xdebug as server debugger.

Suppose I have the following html script:
<html>
<head><title>Chunkify Form</title></head>
<body>
<form action="temp.php" method="POST">
Enter a word: <input type="text" name="word" /><br />
How long should the chunks be?
<input type="text" name="number" /><br />
<input type="submit" value="Chunkify!">
</form>
</body>
</html>

It takes 2 variables named "word" and "number" from user input and split the word input into a number of chunks. The php script that does the splitting looks like this:

<html>
<head><title>Chunked Word</title></head>
<body>

<?php
function raw_param ($name) {
	return ini_get('magic_quotes_gpc')
	? stripslashes($_POST[$name])
	: $_POST[$name];
}

$word=raw_param('word');
$number = $_POST['number'];

$chunks = ceil(strlen($word)/$number);

echo "The $number-letter chunks of '$word' are:<br />\n";

for ($i=0; $i < $chunks; $i++) {
	$chunk = substr($word, $i*$number, $number);
	printf("%d: %s<br />\n", $i+1, $chunk);
}
?>

</body>
</html>


What I'm trying to do is step through the php script and keep-tracks the _POST variable and others as well. However the debugger doesn't stop at the breaking point to do the step through, instead it goes all the way down and ends the script.

Is it possible to do the attempt that I'm doing using xdebug?

Regards,
Ethereal1m
Re: Using Xdebug to step through php script on webserver [message #508325 is a reply to message #508251] Mon, 18 January 2010 12:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dkel50.hotremovemail.com

Yes you can, please read the documentation about xdebug support at
http://www.eclipse.org/pdt/documents/XDebugGuideForPDT2.0.pd f

so you can check that xdebug is definitely enabled on your webserver and
configured correctly, also please read up about path mapping to see if
it applies to you.

Dave Kelsey

On 18/01/10 06:08, Ethereal1m wrote:
> Dear experts,
> I try to step through php script that is running on a webserver. I set
> the debug configuration by setting the web server, the script, and set
> xdebug as server debugger.
> Suppose I have the following html script:
>
> <html>
> <head><title>Chunkify Form</title></head>
> <body>
> <form action="temp.php" method="POST">
> Enter a word: <input type="text" name="word" /><br />
> How long should the chunks be?
> <input type="text" name="number" /><br />
> <input type="submit" value="Chunkify!">
> </form>
> </body>
> </html>
>
> It takes 2 variables named "word" and "number" from user input and split
> the word input into a number of chunks. The php script that does the
> splitting looks like this:
>
>
> <html>
> <head><title>Chunked Word</title></head>
> <body>
>
> <?php
> function raw_param ($name) {
> return ini_get('magic_quotes_gpc')
> ? stripslashes($_POST[$name])
> : $_POST[$name];
> }
>
> $word=raw_param('word');
> $number = $_POST['number'];
>
> $chunks = ceil(strlen($word)/$number);
>
> echo "The $number-letter chunks of '$word' are:<br />\n";
>
> for ($i=0; $i < $chunks; $i++) {
> $chunk = substr($word, $i*$number, $number);
> printf("%d: %s<br />\n", $i+1, $chunk);
> }
> ?>
>
> </body>
> </html>
>
>
> What I'm trying to do is step through the php script and keep-tracks the
> _POST variable and others as well. However the debugger doesn't stop at
> the breaking point to do the step through, instead it goes all the way
> down and ends the script.
> Is it possible to do the attempt that I'm doing using xdebug?
>
> Regards,
> Ethereal1m
Re: Using Xdebug to step through php script on webserver [message #508334 is a reply to message #508251] Mon, 18 January 2010 13:34 Go to previous message
Ethereal1m Mising name is currently offline Ethereal1m Mising nameFriend
Messages: 37
Registered: January 2010
Member
thanks, I should have checked the doc section earlier.... Razz
Previous Topic:'xxx.php is not a PHP file' setting up Run Configuration (for any php file)
Next Topic:Can't create first project
Goto Forum:
  


Current Time: Sun May 09 08:40:53 GMT 2021

Powered by FUDForum. Page generated in 0.02139 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top