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

来源:互联网 发布:php 在线客服 免费 编辑:程序博客网 时间:2024/04/27 14:47








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,路径必须正确;











原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 惠州市住房公积金管理中心 玉林住房公积金查询个人账户 枣庄住房公积金查询 六安住房公积金管理中心 厦门住房公积金查询 渭南市住房公积金个人查询 乐山住房公积金查询个人账户 深圳住房公积金电话多少 南宁住房公积金查询 住房公积金查询电话12329 济宁住房公积金管理中心 宁德市住房公积金查询窗口 兰州市住房公积金查询系统 孝感住房公积金查询 兰州住房公积金查询 滁州住房公积金 上海住房公积金网 个人住房公积金查询网 省住房公积金管理中心 韶关市住房公积金管理中心 长沙住房公积金管理中心 赣州住房公积金查询 西安住房公积金查询 南充住房公积金查询 北京住房公积金查询 南宁住房公积金查询个人账户 东莞住房公积金 资阳住房公积金查询 西安市住房公积金查询系统 郑州住房公积金查询 连云港市住房公积金查询系统 上海住房公积金查询个人账户 滁州住房公积金查询 住房公积金办理条件 住房公积金怎么交 住房公积金密码是什么 赣州住房公积金查询个人账户 南宁市住房公积金中心 昆山住房公积金查询 住房公积金办理 宜宾住房公积金查询