我有一个PHP文件,我想在Eclipse中调试该文件。我听说过Xdebug是在Eclipse中调试PHP文件的最佳方法。
能够在Eclipse中调试PHP文件需要执行哪些步骤?我正在使用Windows操作系统。
使用更新网址https://download.eclipse.org/tools/pdt/updates/7.0
现在您可以按照此处的其他说明进行操作,或者继续进行下一个要点,我将解释您的操作。http://robsnotebook.com/php_debugger_pdt_xdebug
下载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
在Eclipse中配置PHP调试您可以创建一个PHP项目。该项目应该指向C:\ xampp \ htdocs
C:\ xampp \ htdocs是xampp中的本地服务器根文件夹。在内部可以创建子文件夹。
配置eclipse的PHP首选项用xampp的php解析器连接eclipse
进行此配置,并检查从xampp的Eclipse中是否检测到xdebug
最后,您将在调试透视图中看到,调试器会自动停止在php文件的第一行。