简体   繁体   English

在Fedora上使用Xdebug和Netbeans进行调试

[英]Debugging with Xdebug and Netbeans on Fedora

如何在Fedora 17操作系统上安装Xdebug以便与netbeans 7.3(测试版)一起使用?

Install Xdebug: 安装Xdebug:

sudo yum install php-pecl-xdebug.x86_64 sudo yum安装php-pecl-xdebug.x86_64

Add this lines to php.ini at the end of /etc/php.ini 将这一行添加到/etc/php.ini末尾的php.ini中

zend_extension=/usr/lib64/php/modules/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000

Add the same lines to /etc/php-zts.d/xdebug.ini : 将相同的行添加到/etc/php-zts.d/xdebug.ini

xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000

Allow port for Xdebug 允许Xdebug的端口

sudo semanage port -a -t http_port_t -p tcp 9000

Now find your netbeans.conf file in your system: 现在在您的系统中找到您的netbeans.conf文件:

sudo find / -name netbeans.conf

Now, open up the file and add the text “-J-Dorg.netbeans.modules.php.dbgp.level=400″ in netbeans_default_options so that the line looks somewhat like this: 现在,打开文件并在netbeans_default_options中添加文本“-J-Dorg.netbeans.modules.php.dbgp.level = 400”,以使该行看起来像这样:

netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-Dnetbeans.logger.console=true -J-ea -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.zip.disableMemoryMapping=true -J-Dsun.awt.disableMixing=true -J-Dnetbeans.extbrowser.manual_chrome_plugin_install=yes -J-Dorg.netbeans.modules.php.dbgp.level=400" netbeans_default_options =“ - J-client -J-Xss2m -J-Xms32m -J-XX:PermSize = 32m -J-Dnetbeans.logger.console = true -J-ea -J-Dapple.laf.useScreenMenuBar = true -J- Dapple.awt.graphics.UseQuartz = true -J-Dsun.java2d.noddraw = true -J-Dsun.zip.disableMemoryMapping = true -J-Dsun.awt.disableMixing = true -J-Dnetbeans.extbrowser.manual_chrome_plugin_install = yes - J-Dorg.netbeans.modules.php.dbgp.level = 400"

Restart both NetBeans IDE and apache: 重新启动NetBeans IDE和apache:

sudo service httpd restart
Configure php.ini for xDebug
Use: output_buffering = Off
Comment out any lines that configures output_buffering such as output_buffering = 4096
Add the following to /etc/php.ini
zend_extension=”/usr/lib/php5/…../xdebug.so”
[xdebug]
;xdebug.remote_autostart = 0
xdebug.remote_enable = true
xdebug.remote_handler=dbgp
;xdebug.remote_mode=”req”
xdebug.remote_port = 9001
xdebug.remote_host = 127.0.0.1
xdebug.profiler_enable = 1
xdebug.profiler_output_dir = “/tmp/”
xdebug.idekey=”netbeans-xdebug”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM