【发布时间】:2017-09-16 09:35:58
【问题描述】:
我想要的是在使用 Netbeans 的本地开发环境中使用 XDebug 调试 TYPO3 代码。
我拥有的是:
- MacOS 塞拉利昂
- Netbeans 8.2
- 流浪者 1.8.7
- Virtualbox 5.1.26
- LAMP 堆栈(Debian Stretch、Apache 2.4、PHP-FPM 7.0、MariaDB 10.1)
- Typo3 8.7.6(标准模式不是作曲家)
Typo3的文件夹结构还是推荐的
/typo3_src-8.7.6
/typo3/typo3_src -> ../typo3_src-8.7.6
/typo3/index.php -> typo3_src/index.php
/typo3/typo3 -> typo3_src/typo3
相应的 XDebug 参数是
php_admin_value[xdebug.remote_enable] = 1
php_admin_value[xdebug.remote_host] = 192.168.33.1
php_admin_value[xdebug.remote_port] = 9000
php_admin_value[xdebug.remote_handler] = dbgp
php_admin_value[xdebug.max_nesting_level] = 400
Netbeans中的PHP项目在“运行配置”>“高级..”下设置了如下路径映射:
Server Path Project Path
/var/www/html/typo3 /Users/{me}/{project}/typo3
Netbeans 正在侦听端口 9000 以及 XDebug。启动调试时,相应的 xdebug.log 显示成功:
Log opened at 2017-09-16 08:17:52
I: Connecting to configured address/port: 192.168.33.1:9000.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///var/www/html/typo3_src-8.7.6/index.php" language="PHP" ..></init>
问题是:XDebug 无法识别断点。
向typo3 源添加额外的路径映射时
Server Path Project Path
/var/www/html/typo3 /Users/{me}/{project}/typo3
/var/www/html/typo3_src-8.7.6 /Users/{me}/{project}/typo3
然后 Netbeans 在设置“在第一行停止”时至少停止在 /typo3/index.php。但它仍然不会在 /typo3/typo3conf/ext/.. 下的自定义typo3扩展中的自定义断点处停止。将所有符号链接替换为它们的真实源(index.php 和typo3)时,调试就像一个魅力。
是否有方法来解决默认 TYPO3 8 LTS 安装的符号链接的这些路径映射?
【问题讨论】:
-
添加此路径映射是否有帮助?:
/var/www/html /Users/{me}/{project}还要确保端口 9000 未在其他地方使用,尝试其他端口,例如9001或者
标签: php netbeans vagrant typo3 xdebug