Home > php教程 > php手册 > body text

php环境配置及调试配置的方法

WBOY
Release: 2016-06-13 09:28:37
Original
1652 people have browsed it

php环境配置及调试配置的方法

   今日打算学习PHP,工具还是使用我熟悉的eclipse。为了php环境的配置和调试配置,我花了很大功夫研究哈,以下是整理出来的方法:

  1.安装和配置PDT

  下载PDT: download.eclipse.org/tools/pdt/downloads/index.php, 选择最新版本

  PDT是Eclipse的插件。

  选择pdt-all-in-one版本, 否则需要另外下载eclipse和相关插件, 并手工集成.

  2.安装debug环境

  由于我用的是最新的xampp1.7.2,试了二天xdebug,出现如下如题:waiting for xdebug session,停止的了57%的进度上,程序无法调试。可能是xdebug和php5.3之间的问题。因此决定改用旧版xampp1.6.8,php的版本是5.2.6。结果还是出现了以上问题,让我不得其解,不得以,换成zend debugger。

  xampp版本为1.6.8,从这里下载zend debugger 5.2.x。将文件解压后复制到\xampp\php\ext目录。

  打开\xampp\apache\bin目录下的php.ini。的最后添加:

  zend_extension_ts = "c:\xampp\php\ext\ZendDebugger.dll"

  zend_debugger.allow_hosts=127.0.0.1/10,192.168.88.146

  zend_debugger.expose_remotely=always

  其中192.168.88.146是你机子上的IP地址。

  3.设置PDT下的debug环境

  启动Eclipse,将code目录设置为"xampp\htdocs",这样代码直接放到apache的WEB目录下

  从主菜单打开"Window > Preferences > PHP",

  先选中"PHP Excutables"节点,在右面的面板点"Add"按钮,在接下来的窗口中,

  选中"Debug"节点,在右面的面板中,

  "PHP Debugger"选择XDebug,

  "Server"不用变

  "PHP Executable"也选择你刚刚添加的那个"xampp-zend"

  在PHP Debug透视图中可以点击Debug View中的图标或用快捷键来进行单步跟踪,比如:

  F5: 单步跳入(可以跳入require()函数来跟踪到别的PHP文件哟)

  F6: 单步跳过

  F7: 单步跳出(可以从被require()的文件内跳回调用者哟)

  F8: 继续执行(直到遇到下一个断点)

  Ctrl+R: 执行到光标所在行(除非遇到断点)

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!