zend studio for eclipse 设置及 debug 页面跳转调试




http://hi.baidu.com/doyee/blog/item/98c6da4355d9721573f05d88.html

http://www.zend.com/en/products/studio/downloads,下载相关文件
Studio for Eclipse
ZendDebugger
Studio Browser Toolbars

调试注意事项
PHP的调试与我们开发Java时有点不一样,PHP的断点调试要借助在浏览器安装Zend Studio Toolbar和在PHP中安装配置Zend Debugger插件,调试由点击浏览器的Zend Studio Toolbar的Debug项触发。

1. 选中“Current page”时,代表调试当前页,即浏览器URL所代表的当前页,假设当前URL为phpBB的某个URL。
2. “Next page”代表从当前页触发的请求将进入调试状态。
3. “All forms (POST) on this site”所有表单请求将进入调试状态。
4. “All page on this site”所有页面将进入调试状态

当Zend Studio进入调试状态时,首选会在页面首行处停下来,即便首行没有断点,所以如果要进入用户自己设置的断点,还得按一次Zend Studio for Eclipse的Debug窗口的Rusume按钮。


Zend Debugger安装
官网下载Zend Debugger,下载URL:
http://downloads.zend.com/pdt/server-debugger/ZendDebugger-5.2.14-cygwin_nt-i386.zip

1.安装zend studio for eclipse
在php安装目录的php.ini里加入
[Zend]
zend_extension_ts=D:/PHP/ext/ZendDebugger.dll
zend_debugger.allow_hosts=127.0.0.1/32
zend_debugger.allow_tunnel=127.0.0.1/32
zend_debugger.expose_remotely=always

ZendDebugger.dll要选择与php版本相匹配的
3、把debugger带的dummy.php复制到apache网站根目录 如:D:\Apache2.2\htdocs
4、重启apche服务。
5、启动zend studio for eclipse,并新建一个工程



工作目录选择apache 站点根目录 如:D:\Apache2.2\htdocs

5.给新建的空工程添加两个文件,一个提交给另一个处理,我们开始web page的调试

文件一:OrderForm.html 内容如下

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>:::Order Form:::</title>
</head>

<body>
<form id="OrderForm" name="OrderForm" method="post" action="ProcessOrder.php">
<table width="200" border="0">
<tr bgcolor="#999999">
    <td>Item</td>
    <td>Quantity</td>
</tr>
<tr>
    <td>Tires</td>
    <td><input name="tireqty" type="text" id="tireqty" size="3" maxlength="3" /></td>
</tr>
<tr>
    <td>Oil</td>
    <td><input name="oilqty" type="text" id="oilqty" size="3" maxlength="3" /></td>
</tr>
<tr>
    <td>Spark Plugs </td>
    <td><input name="sparkqty" type="text" id="sparkqty" size="3" maxlength="3" /></td>
</tr>
<tr>
<td><input type="submit" name="Submit" value="submit" /></td>
</tr>
</table>
</form>
</body>
</html>

文件二:ProcessOrder.php 内容如下

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Bob's Auto Parts Order Result</title>
</head>

<body>
<h1>Bob's Auto Parts</h1>
<h2>Order Result</h2>
<?php
/*title*/
echo '<p>Order Processed at ';
echo date('H:i, jS F');
echo '</p>';
/*fetch variable*/
$tireQty = $_POST['tireqty'];
$oilQty   = $_POST['oilqty'];
$sparkQty = $_POST['sparkqty'];

/*calculate*/
$totalQty = 0;
$totalQty = $tireQty + $oilQty + $sparkQty;
$totalAmount = 0.00;
$subTotalAmount = 0.00;
define('TIREPRICE',100);
define('OILPRICE' ,10);
define('SPARKPRICE' , 4);
$subTotalAmount = $tireQty * TIREPRICE + $oilQty * OILPRICE + $sparkQty * SPARKPRICE;
$taxRate = 0.10;
$totalAmount = $subTotalAmount * (1 + $taxRate);
/*display Result*/
echo $tireQty.' Tires </br>';
echo $oilQty.' Oil</br>';
echo $sparkQty.' Spark Plugs </br>';
echo 'Sub TotalAmount: '.number_format($subTotalAmount ,2).'</br>';
echo 'totalAmount include tax :'.number_format($totalAmount,2).'</br>';

?>
</body>
</html>

6.接下来调试这两个页面



很重要的一步:window->preferences->General->web browser ,使用ie进行调试

打开ie:输入http://localhost:8080/OrderForm.html



此时会debug停在processOrder.php的<?php ?>中的第一条语句

----------------------------------------------

我的调试配置

1,

2,


3,


4,


5,


注意事项:

1,项目必须处于打开状态;

2,路径必须正确;


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值