Zend Debbugger包含了错误的文件。
包括
/home/jlam/code/tenjin/src/wordpress/wp-content/plugins/badgeos/includes/steps-ui.php
,而不是
/home/jlam/code/tenjin/src/wordpress/wp-content/plugins/badgeos-community-add-on/includes/steps-ui.php
如您所见,这些文件具有相同的文件名,但路径不同。
以下是发生的事情:
我正在使用Zend Debugger v5.3和Zend Engine v2.4.0,php 5.4来调试Wordpress 4.2.1,插件BadgeOS 1.4.4和BadgeOS Community Add-On v 1.2.0(加上一些不相关的内容)插件)。
我在Eclipse控制台中遇到以下编译错误:
Compile Error: /tenjin/src/wordpress/wp-content/plugins/badgeos/includes/steps-ui.php line 23 - Cannot redeclare badgeos_steps_ui_admin_scripts() (previously declared in /home/jlam/code/tenjin/src/wordpress/wp-content/plugins/badgeos-community-add-on/includes/steps-ui.php:18)
badgeos_steps_ui_admin_scripts
实际上并不存在于/home/jlam/code/tenjin/src/wordpress/wp-content/plugins/badgeos-community-add-on/includes/steps-ui.php
Zend Debugger实际上包括/tenjin/src/wordpress/wp-content/plugins/badgeos/includes/steps-ui.php
两次,而不是假设。
以下是我的判断方法:
我在/tenjin/src/wordpress/wp-content/plugins/badgeos-community-add-on/badgeos-community.php
第90行有一个断点。指示
require_once( $this->directory_path . '/includes/steps-ui.php' );
$this->directory_path
的值为/home/jlam/code/tenjin/src/wordpress/wp-content/plugins/badgeos-community-add-on/
但是,如果我在那一步进入,调试器最终会在第18行
/home/jlam/code/tenjin/src/wordpress/wp-content/plugins/badgeos/includes/steps-ui.php
,
不
/home/jlam/code/tenjin/src/wordpress/wp-content/plugins/badgeos-community-add-on/includes/steps-ui.php
答案 0 :(得分:1)
正如http://www.kpsolution.com/php/zend-debugger-loading-wrong-file-while-debugging/115/所建议的那样,路径映射是错误的。
‘Windows’ -> ‘Preferences’ -> ‘PHP’ -> ‘PHP Servers’
下此项目的自定义Web服务器中存在额外(和错误)映射。