我正在使用NetBeans中的Xdebug逐步执行CodeIgniter的源代码,我正在寻找一种方法来查看定义的常量.如果不可能,有没有其他方法来显示所有定义的常量?
我刚刚安装了wamp,最新版本附带了webgrind,但我无法弄清楚它是如何工作的.它说
Select a cachegrind file above
Run Code Online (Sandbox Code Playgroud)
就这样.
我在使用xampp的Ubuntu服务器上安装xdebug时遇到问题.我知道在Stack Overflow中有几个关于这类问题的问题,但我找不到任何解决方案.
首先这是php --version命令的输出:
PHP 5.3.8 (cli) (built: Sep 19 2011 13:29:27)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
with Xdebug v2.2.0, Copyright (c) 2002-2012, by Derick Rethans
Run Code Online (Sandbox Code Playgroud)
输出php --ini命令:
Configuration File (php.ini) Path: /opt/lampp/etc
Loaded Configuration File: /opt/lampp/etc/php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed: (none)
Run Code Online (Sandbox Code Playgroud)
输出php -m命令:
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dba
dom
ereg
exif
fileinfo …Run Code Online (Sandbox Code Playgroud) 我已阅读此文档:http://xdebug.org/docs/remote
我可以调试我的Web应用程序.
但调试器不会启动控制台命令.
我的.Debug的.ini文件(它可以工作):
$ cat /etc/php5/fpm/conf.d/xdebug.ini
zend_extension=/usr/lib/php5/20090626/xdebug.so
xdebug.idekey="PHPSTORM"
xdebug.remote_connect_back=1
xdebug.remote_enable=1
Run Code Online (Sandbox Code Playgroud)
.ini文件cli是一样的.
我也尝试export XDEBUG_CONFIG="idekey=PHPSTORM remote_enable=1 remote_connect_back=1"在调试之前添加,但它没有帮助.
我该如何启用它?
我正尝试在本地调试NetBeans Mac.
这是我的php.ini
[xdebug]
xdebug.default_enable=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_autostart=1
xdebug.remote_log="/Applications/MAMP/logs/xdebug.log"
xdebug.idekey="netbeans-xdebug"
zend_extension="/Applications/MAMP/bin/php/php5.4.10/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so"
Run Code Online (Sandbox Code Playgroud)
这是我在xdebug.log中获得的
I: Connecting to configured address/port: localhost:9000.
E: Could not connect to client. :-(
Run Code Online (Sandbox Code Playgroud)
我尝试将端口更改为9001并关闭防火墙,但它没有帮助.
我设置了Laravel Homestead.然后我配置了宅基地xdebug.ini和PHPStorm以使调试工作.
这是我家园内的xdebug.ini
zend_extension=xdebug.so
xdebug.remote_autostart = on
xdebug.remote_enable = on
xdebug.remote_connect_back = on
xdebug.remote_port = 9000
xdebug.idekey = "vagrant"
Run Code Online (Sandbox Code Playgroud)
要开始调试会话,我遵循的步骤是
这非常有效.我的问题是当我进入宅基地命令行并且我运行一个php artisan命令然后我无法让它达到我的断点.
我试过的
XDEBUG_CONFIG="idekey=PHPSTORM" PHP_IDE_CONFIG="serverName=server_name" php -dxdebug.remote_host="127.0.0.1" artisan mycommand
php -d xdebug.profiler_enable=On artisan mycommand
我也试着设置xdebug.remote_autostart=On,然后sudo service php5-fpm restart,但仍然是我的断点永远不会打PHPStorm
我在开发环境中遇到了Xdebug的问题.
FROM library/php:5.5-apache
RUN apt-get -qqy update && apt-get -qqy install \
libpq-dev \
libmcrypt-dev \
libxml2-dev \
ssl-cert \
vim \
git \
mc \
&& rm -r /var/lib/apt/lists/*
# compile and add xdebug
RUN pecl install xdebug \
&& echo "zend_extension=xdebug.so" >> "/usr/local/etc/php/conf.d/xdebug.ini"
# configure apache and vhosts
RUN a2enmod rewrite ssl \
&& a2ensite 000-default default-ssl
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2
ENV APACHE_RUN_DIR /var/run/apache2
ENV APACHE_PID_FILE /var/run/apache2/apache2.pid
ENV APACHE_LOCK_DIR /var/lock/apache2
CMD ["apache2-foreground"]
Run Code Online (Sandbox Code Playgroud)
Xdebug设置: …
我用PHPStorm 2016.2调试PHP 5.2(我知道它已经老了),

但是当我在我的apache vhost文件中添加auto_prepend_file或auto_append_file时:
php_value auto_prepend_file /home/abc/def/apache_prepend.php
php_value auto_append_file /home/abc/def/apache_append.php
Run Code Online (Sandbox Code Playgroud)
xdebug休息.
IDE在第一个断点处停止,然后当我尝试跳过/进入/退出并且浏览器返回"没有收到数据"时调试停止.
我的xdebug.conf文件:
#[xdebug]
php_value xdebug.remote_enable on
#php_value xdebug.default_enable on
php_value xdebug.remote_autostart off
php_value xdebug.remote_port 9000
php_value xdebug.remote_host 192.168.100.66
php_value xdebug.profiler_enable 0
php_value xdebug.profiler_enable_trigger 1
php_value xdebug.profiler_output_name cachegrind.out-%H-%R-%t
php_value xdebug.profiler_output_dir /home/abc/xdebug-profile
php_value xdebug.trace_enable_trigger 1
#php_value xdebug.auto_trace off
php_value xdebug.trace_output_name trace.out-%H-%R-%t
php_value xdebug.trace_format 1
php_value xdebug.idekey PHPSTORM
Run Code Online (Sandbox Code Playgroud) 在 CLI 中使用 Xdebug 3 时,它会在没有设置断点时不断报告消息:
"Xdebug: [Step Debug] Could not connect to debugging client. Tried: localhost:9003 (through xdebug.client_host/xdebug.client_port) :-("
Run Code Online (Sandbox Code Playgroud)
有没有办法禁用在 CLI 中显示的消息表单?
可能重复:
如何禁用XDebug
我已经安装了xdebug,但它使我的单元测试慢得多.有没有办法通过ini_set或其他方式禁用它.我尝试了xdebug_disable(),但没有任何区别,除非我更改php.ini文件.
我的想法是只在生成代码覆盖率报告时打开xdebug,我之前不需要它.