Netbeans + Xdebug + php 不工作
我的netbeans无法使用xdebug断点,我的配置看起来是正确的,所以我在第一次运行时配置为停止调试,此后第一次从未工作过,有人遇到这个问题吗?我的netbeans版本是6.8,php版本是2.5.2。
我的 php.ini:
zend_extension_ts = d:\wamp\bin\php\php5.2.5\ext\php_xdebug-2.0.2-5.2.5.dll
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.idekey=netbeans-xdebug
xdebug.profiler_enable=1
My netbeans does not work the breakpoints using xdebug, my configuration looks correct, so I configured the first time I ran up to stop debugging the first time since then has never worked, someone had this problem? The version of my netbeans is 6.8 and the version of php is 2.5.2.
my php.ini:
zend_extension_ts = d:\wamp\bin\php\php5.2.5\ext\php_xdebug-2.0.2-5.2.5.dll
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.idekey=netbeans-xdebug
xdebug.profiler_enable=1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
就我而言,这一行需要包含在 php.ini 中:
这是 XDebug 的配置部分:
In my case this line needed to be included in the php.ini:
Here is the configuration section for XDebug:
xdebug 清单:
phpinfo()
中,以及运行时值 匹配预期配置。xdebug.remote_enable
已开启
。xdebug.extended_info
应该开启
让断点起作用。xdebug.remote_port
必须与 ide 相同且未使用。xdebug.remote_handler
是dbgp
。xdebug.remote_autostart<,则
xdebug.idekey
应设置为与ide的密钥相同 /代码> 已打开。xdebug.remote_host
设置为内网IP或计算机名称而不是本地IP 127.0.0.1会有所帮助。 PHP 必须防火墙允许才能连接到此主机和端口。示例配置:
NetBeans 清单:
(大多数默认选项都是开箱即用的,因此,如果您绝望,请尝试删除并重新创建项目。)
错误说明,在 PHP 5.5 和 xdebug 2.2 上进行了测试:
output_buffering
不需要关闭。 (但可能有助于调试)xdebug.profiler_enable
。如果您发现新内容,请编辑此答案。
Checklist for xdebug:
phpinfo()
, and the runtime value matches expected configuration.xdebug.remote_enable
ison
.xdebug.extended_info
should beon
for breakpoints to work.xdebug.remote_port
must be same as ide and unused.xdebug.remote_handler
isdbgp
.xdebug.idekey
should be set to same as ide's key ifxdebug.remote_autostart
is on.xdebug.remote_host
to intranet IP or computer name instead of local ip 127.0.0.1. PHP must be allowed by Firewall to connect to this host and port.xdebug.remote_log
to a file will help in checking what is wrong. Disable the log once debug is working.Sample config:
Checklist for NetBeans:
(Most default options work out of the box, so if you are desperate try to delete and recreate the project.)
False Instructions, tested on PHP 5.5 and xdebug 2.2:
output_buffering
does not need to be off. (But may help in debugging)xdebug.profiler_enable
can be enabled.Please edit this answer if you found something new.
(我正在回复答案,因为评论中的格式无法正常工作)
我也发生了同样的事情:工作一次然后停止。然而,我的配置达到了一个点,它开始正常工作,没有问题,我可以分享。
首先,我将 ioncube 加载器移至 php.ini 之上:
然后我将这些行放入 xdebug 配置中:
并注释掉有关 Zend Optimizer
我在 MAMP 上工作的所有行,这就是为什么我的库的路径引用我的 MAMP文件夹。
祝你好运
(I am replying with an Answer since the formatting in comments wasn't working properly)
Same happened for me: worked once and then stopped. However, I reached a point in my config where it started working without problems and I can share.
First I moved on top of php.ini the ioncube loader:
Then I put these lines in the xdebug config:
And commented out all the lines about Zend Optimizer
I work on MAMP, this is why the paths to my libraries are referred to my MAMP folder.
Good luck
zend_extension = "C:\xampp\php\ext\php_xdebug-2.2.3-5.4-vc9.dll"xdebug.remote_enable = 1 xdebug.remote_handler = "dbgp"xdebug.remote_host = "localhost" xdebug.remote_port= "9000" xdebug.remote_mode=req xdebug.trace_output_dir = "C:\xampp\tmp" xdebug.idekey="netbeans-xdebug"
这对我有用..
zend_extension = "C:\xampp\php\ext\php_xdebug-2.2.3-5.4-vc9.dll"xdebug.remote_enable = 1 xdebug.remote_handler = "dbgp"xdebug.remote_host = "localhost" xdebug.remote_port="9000" xdebug.remote_mode=req xdebug.trace_output_dir = "C:\xampp\tmp" xdebug.idekey="netbeans-xdebug"
this is working for me..
以下是我如何让它在多个 PHP-FPM 自制软件安装中工作。
我将这篇优秀的文章用于多个安装:
https://echo.co/blog/os-x-1010-yosemite-local-development-environment-apache-php-and-mysql-homebrew
在那篇文章的评论中,您'您将看到建议的如何安装 xdebug,底线:
您必须为已安装的每个 PHP 版本安装 xdebug。 Homebrew 将为您安装的每个版本的 php 制作一个 xdebug.ini 文件。每个都有这样的路径:
本文安装了在 xdebug 的默认端口 (9000) 上运行的 DNSMasq,因此您需要将 xdebug 端口更改为其他端口(9001 工作正常。)
编辑上面提到的 ext-xdebug.ini 文件(如果您安装了多个版本的 php,则为文件。) 以下是对我有用的内容:
前两行是原始自制文件中的全部内容。
顺便说一句 - 当我安装多个 PHP 版本时,此 ext-xdebug.ini 文件仅为我安装的第一个 PHP 版本创建。我只是将此文件复制到其他 PHP 版本位置,并更改第 2 行中路径的“php56-xdebug”部分以反映正确的 PHP 版本。
注意“xdebug.remote_port=9001”,
然后在 Netbeans 中(我使用的是 8.02 Mac osX10.10.3),我使用以下设置。
转到首选项->PHP->调试
调试器端口:9001
停在第一行:(未选中)
Watches &气球评估:(检查 - 有一个警告,但它对我来说效果很好。)
还值得注意的是,为了让 xdebug 使用 phpinfo() (或命令行 php -i)显示,我需要重新启动apache:
出于某种原因,我的设置要求我每次启动时都运行它。有点痛苦,但我将其合并到 shell 命令中以轻松在版本之间切换。
还有一个提示:brew info php56 的一部分说:
在我将其添加到我的 .profile_bash 文件之前,我对每个版本的 php-fpm.conf 文件所做的更改都无法识别。其他一切似乎都有效,所以很混乱。
希望这可以节省其他人的时间和时间。麻烦。
Here's how I was able to get it to work w/ mulitple PHP-FPM homebrew installations.
I used this excellent article for the multiple installations:
https://echo.co/blog/os-x-1010-yosemite-local-development-environment-apache-php-and-mysql-homebrew
In the comments of that post you'll see recommended how to install xdebug, bottom line:
You have to install xdebug for each verions of PHP you have installed. Homebrew will make a xdebug.ini file for each version of php you installed. Each will have a path like:
This article installs DNSMasq which runs on xdebug's default port (9000), so you'll need to change the xdebug port to something else (9001 works fine.)
Edit the above mentioned ext-xdebug.ini file (or files if you installed more than one version of php.) Here's what works for me:
The first two lines are all that is in the original homebrew file.
BTW - when I installed multiple PHP versions, this ext-xdebug.ini file was only created for the first PHP version I installed. I simply copied this file to the other PHP version locations, and changed the "php56-xdebug" part of the path in line 2 to reflect the proper php version.
Notice "xdebug.remote_port=9001"
Then in Netbeans (I'm using 8.02 Mac osX10.10.3) I use the following settings.
Go to Preferences->PHP->Debugging
Debugger Port: 9001
Stop at First Line: (unchecked)
Watches & Balloon Evaluation: (checked - there's a warning but it works fine for me.)
Also worth noticing is that in order for xdebug to show up using phpinfo() (or command line php -i) I need to restart apache with:
For some reason my setup requires me to run this every time I startup. Kind of a pain, but I incorporated it in a shell command to easily switch between versions.
One more hint: part of brew info php56 says:
Until I added this to my .profile_bash file, changes I made to each version's php-fpm.conf file were not recognized. Everything else seemed to work so it was confusing.
Hope this saves someone else time & trouble.
如果您仍然遇到困难,可以尝试以下操作:
xdebug.idekey=netbeans-xdebug
。始终确保重新启动 apache 服务来测试一切。
If you are still stuck you could try the following:
xdebug.idekey=netbeans-xdebug
.Always make sure that you restart your apache service to test everything.
就我而言 - 主机位于另一台服务器 Net-beans 11 上 - 我需要打开远程主机的终端
Window -> IDE 工具 ->终端->远程终端
PS如果您在该终端中输入 export XDEBUG_CONFIG="idekey=netbeans-xdebug" 并启动调试会话,您可以调试控制台脚本
In my case - host is on another server, Net-beans 11 - I need to open terminal to remotehost
Window -> IDE Tools -> Terminal -> Remote Terminal
P.S. If u type export XDEBUG_CONFIG="idekey=netbeans-xdebug" in that terminal, and start debugging session, u can debug console scripts