Using Xdebug to step through php script on webserver [message #508251] |
Mon, 18 January 2010 06:08 |
Ethereal1m Mising name 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 |
Eclipse User |
|
|
|
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
|
|
|
|
Powered by
FUDForum. Page generated in 0.03187 seconds