search
Homephp教程php手册php环境配置及调试配置的方法

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

Jun 13, 2016 am 09:28 AM
phptodaystudytoolmethodenvironmentofdebugstillConfiguration

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: 执行到光标所在行(除非遇到断点)

Statement
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Atom editor mac version download

Atom editor mac version download

The most popular open source editor