如何在Windows上的Eclipse中安装PHP Xdebug?

问题描述 投票:0回答:1

我有一个PHP文件,我想在Eclipse中调试该文件。我听说过Xdebug是在Eclipse中调试PHP文件的最佳方法。

能够在Eclipse中调试PHP文件需要执行哪些步骤?我正在使用Windows操作系统。

php windows eclipse xdebug
1个回答
0
投票
  1. 下载用于Eclipse的PHP(Eclipse插件)

使用更新网址https://download.eclipse.org/tools/pdt/updates/7.0Here the PHP PDT plugin you need in eclipse

  1. 下载用于Windows的XAMPP并安装它https://www.apachefriends.org/es/download.html

现在您可以按照此处的其他说明进行操作,或者继续进行下一个要点,我将解释您的操作。http://robsnotebook.com/php_debugger_pdt_xdebug

安装XAMPP之后,您应该启动ApacheXAMPP control interface

下载Xdebug例如http://xdebug.org/files/php_xdebug-2.9.2-7.2-vc15-x86_64.dll,并检查其是否正确安装。按照下一个说明

1. Download php_xdebug-2.9.2-7.2-vc15-x86_64.dll. 
2. Move the downloaded file to C:\xampp\php\ext
3. Update C:\xampp\php\php.ini and change the lines

    [XDebug]
    ;; Only Zend OR (!) XDebug
    ; zend_extension_ts="C:\xampp\php\ext\php_xdebug.dll"
    ; Modify the filename below to reflect the .dll version of your xdebug
    zend_extension = C:\xampp\php\ext\php_xdebug-2.9.2-7.2-vc15-x86_64.dll
    xdebug.remote_enable=true
    xdebug.remote_host=127.0.0.1  ; if debugging on remote server,
                              ; put client IP here
    xdebug.remote_port=9000
    xdebug.remote_handler=dbgp
    xdebug.profiler_enable=0
    xdebug.profiler_output_dir="C:\xampp\tmp"

4. Restart the XAMPP webserver in your XAMPP control Panel

注释掉php.ini中的任何Zend Optimizer,因为它与XDebug不兼容。例如,所有这些都应被注释掉(使用“;”):[Zend]

; zend_extension_ts = "C:\xampp\php\zendOptimizer\lib\ZendExtensionManager.dll"
; zend_extension_manager.optimizer_ts = "C:\xampp\php\zendOptimizer\lib\Optimizer"
; zend_optimizer.enable_loader = 0
; zend_optimizer.optimization_level=15
;zend_optimizer.license_path =

检查是否与phpinfo一起使用。您转到浏览器,然后转到:http://localhost/dashboard/phpinfo.php或在您的c:/ xampp / htdocs中创建调用phpinfo的文件,例如http://localhost/phpinfocall.php

PHPINFO results for XDEBUG sectionWhere to edit your php code

在Eclipse中配置PHP调试您可以创建一个PHP项目。该项目应该指向C:\ xampp \ htdocs

C:\ xampp \ htdocs是xampp中的本地服务器根文件夹。在内部可以创建子文件夹。Rootfolder of localhost, here or on subfolder place your project

配置eclipse的PHP首选项用xampp的php解析器连接eclipse

Connect eclipse with php parser xampp

进行此配置,并检查从xampp的Eclipse中是否检测到xdebugCheckxdebug connection

如何从项目中的PHP文件创建调试视图Howtocreatea debug view from a PHP file in your project

下面的调试视图配置,Debug view configuration_1Debug view configuration_2

最后,您将在调试透视图中看到,调试器会自动停止在php文件的第一行。

Debug view first line breakpoint

© www.soinside.com 2019 - 2024. All rights reserved.