PDT/Xdebug strange behavior - can't resolve it [message #71658] |
Thu, 22 May 2008 22:04  |
Eclipse User |
|
|
|
Originally posted by: alan.catterson.comcast.net
Hello. I've been trying to resolve this for 2 days. Decided I need some help
.... :-)
O/S: XP
PHP: 5.2.6
Debug Build => no
Thread Safety => Enabled
Apache: 2.0.58
Xdebug: 2.0.3
Eclipse: 3.3.0
Build id => I20070625-1500
Eclipse PDT: 1.0.2
PHP.INI excerpt:
[Xdebug]
xdebug.remote_enable=1
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
xdebug.remote_log="C:\Program Files\Apache Group\Apache2\logs\Xdebug.log"
zend_extension_ts=C:\php\ext\php_xdebug-2.0.3-5.2.5.dll"
PROBLEM:
I have a very small PHP app that I'm using to learn PHP. The 2 files are
shown below:
new_player_start_form.html:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Player Entry Form</title>
</head>
<body>
<form id="entry" action="new_player.php"
method="POST">
<p><strong>First Name: </strong> <input type="text" name="firstName" /></p>
<p><strong>Last Name: </strong> <input type="text" name="lastName" /></p>
<input type="submit" value="Save" /></form>
</body>
</html>
new_player.php:
<?php
if (isset($_POST["firstName"])&& isset($_POST["lastName"])) {
require_once(dirname(__FILE__)."/db.php");
$firstName = mysqli_escape_string($conn, $_POST["firstName"]);
$lastName = mysqli_escape_string($conn, $_POST["lastName"]);
$fullName = "$firstName $lastName";
$sql = "insert into Players(First_Name, Last_Name) values
('$firstName','$lastName')";
mysqli_query($conn, $sql);
$id = mysqli_insert_id($conn);
echo "Insert successful for $fullName new ID=$id";
} else {
echo "Please fill in both First and Last names";
}
?>
In eclipse PHP perspective:
-Right click on new_player_start_form.html =>Debug As=>Open Debug Dialog
Debug Dialog Info:
Server debugger: Xdebug
PHP Server: Default PHP Web Server
-Click "Debug"
Here's where it gets strange:
- External browser (IE7) pops up (same thing happens w/ eclipse internal
browser)
- Web page "connecting ..."
- URL:
http://localhost/new_player_start_form.html?XDEBUG_SESSION_S TART=ECLIPSE_DBGP&KEY=12115074127964
- It just hangs there ... forever
- PHP Debug perspective:
- Right Click on "Remote Launch"
- Select "Terminate All"
- After a few seconds, the HTML form I was expecting shows up in browser
- THEN ... 2 MORE external IE7 browsers open
- Both browsers display "DEBUG SESSION ENDED"
- URLs in both browsers are the same (shown below)
http://localhost/new_player_start_form.html?
XDEBUG_SESSION_STOP_NO_EXEC=ECLIPSE_DBGP&KEY=12115074127 964
http://localhost/new_player_start_form.html?XDEBUG_SESSION_S TOP_NO_EXEC=ECLIPSE_DBGP&KEY=12115074127964
Xdebug Log File:
Log opened at 2008-05-23 01:50:40
-> <init xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug"
fileuri="file:///C:/workspace/learn/new_player_start_form.html"
language="PHP" protocol_version="1.0" appid="3820"
idekey="ECLIPSE_DBGP"><engine
version="2.0.3"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick
Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright
(c) 2002-2008 by Derick Rethans]]></copyright></init>
<- feature_set -i 22 -n show_hidden -v 1
-> <response xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set"
transaction_id="22" feature="show_hidden" success="1"></response>
<- feature_set -i 23 -n max_depth -v 3
-> <response xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set"
transaction_id="23" feature="max_depth" success="1"></response>
<- feature_get -i 24 -n max_children
-> <response xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_get"
transaction_id="24" feature_name="max_children"
supported="1"><![CDATA[32]]></response>
<- feature_get -i 25 -n encoding
-> <response xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_get"
transaction_id="25" feature_name="encoding"
supported="1"><![CDATA[iso-8859-1]]></response>
<- feature_get -i 26 -n supports_async
-> <response xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_get"
transaction_id="26" feature_name="supports_async"
supported="1"><![CDATA[0]]></response>
<- breakpoint_set -i 27 -t line -f
file:///C:%5Cworkspace%5Clearn%5Cnew_player.php -n 4
-> <response xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set"
transaction_id="27" id="38200001"></response>
<- run -i 28
-> <response xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run"
transaction_id="28" status="stopping" reason="ok"></response>
Log closed at 2008-05-23 01:53:30
So ... I've googled for 2 days, and I have only found 1 "kind of" reference
to the problem. It suggested upgrading to latest PDT. Did it. Same behavior.
:-(
If anyone has any info that could help me here ... I'd greatly appreciate
it. If its something stupid in the PHP/HTML code ... note that I'm a
beginner :-) Nevertheless ... its a dinky app that works fine outside the
debugger.
Best regards,
Alan
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.26175 seconds