我有一些重复执行的 AJAX 查询。所以,如果 xdebug 正在运行,我不想执行它们中的任何一个。
问题是:如何在PHP代码中判断xdebug当前是否正在运行?
我正在寻找调试PHP脚本的方法.在互联网上我找到了可以用MacGDBp + XDebug做的信息.当我在Shell中使用PECL进行安装时:
sudo pecl install xdebug
The next error have been occured:
downloading xdebug-2.4.0.tgz ...
Starting to download xdebug-2.4.0.tgz (264,832 bytes)
.....................done: 264,832 bytes
76 source files, building
running: phpize
grep: /usr/include/php/main/php.h: No such file or directory
grep: /usr/include/php/Zend/zend_modules.h: No such file or directory
grep: /usr/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for:
PHP Api Version:
Zend Module Api No:
Zend Extension Api No:
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. …Run Code Online (Sandbox Code Playgroud) 我刚刚购买了一台新电脑,并安装了 Ubuntu 14。PHP、Apache、MySQL。一切都运行良好,但 Xdebug 在 PhpStorm 上不起作用。请帮助我如何安装 Xdebug 并将其与 PhpStorm 集成。
当我调试不是在 Docker 容器内创建的项目时,Xdebug 没有问题。
但是,当我调试在 Docker 容器内创建的项目时,Xdebug 不会在断点处停止 - 尽管它正在运行并在 xdebug_break() 处停止。
我的 Docker 主机是 Ubuntu 14.04。它安装为 VirtualBox。它使用 PHP 5.5.9-1ubuntu4.16 和 Xdebug v2.2.3。我有一个已安装的卷(在 Docker 主机和 Docker 容器之间),其中存储了在 Docker 容器内创建的项目。
我在 Ubuntu 14.0.4 中的 Docker 容器基于 CentOS 6.7 版(最终版)。它使用 PHP 5.3.29 和 Xdebug v2.1.4,并且 Xdebug 配置如下(在 /etc/php.d/xdebug.ini 中):
zend_extension=/usr/lib64/php/modules/xdebug.so
;xdebug.remote_autostart = 0
xdebug.remote_autostart = 1
xdebug.remote_connect_back = 1
xdebug.remote_enable = 1
;xdebug.remote_host = 127.0.0.1
;xdebug.remote_host = localhost
;xdebug.remote_host = 172.17.42.1
;xdebug.remote_host = 10.0.2.15
;xdebug.remote_host = 10.0.2.2
;xdebug.remote_port = 9001
xdebug.remote_port = …Run Code Online (Sandbox Code Playgroud) 我可以从代码覆盖率中排除“require_once”语句吗?带有“require_once”的行被报告为未覆盖,但如果脚本中的其他行被覆盖,则不可能:
PHP 7.0.11、PHPUnit 5.5.7 和 XDebug 2.4.0 用于代码覆盖。
在我的php.ini设置这一行:
error_log = c:/php/php_errors.log
Run Code Online (Sandbox Code Playgroud)
它可以将错误输出到指定的文件中.
但是,它总是输出最多4,即:
PHP Fatal error: Uncaught ServiceNotFoundException
Stack trace:
#0 PluginManager.php(124): AbstractPluginManager->get('getEntityManage...', NULL)
#1 AbstractController.php(301): PluginManager->get('getEntityManage...', NULL)
#2 AbstractController.php(316): AbstractController->plugin('getEntityManage...')
#3 AbstractPluginManager.php on line 133
^^^ stops at depth 4 always
Run Code Online (Sandbox Code Playgroud)
我想控制堆栈深度.怎么样?我在http://php.net/error-log上找不到任何东西
使用MacOS Sierra,PhpStorm和Xdebug,在端口80上配置Web应用程序(不从PhpStorm运行).
浏览时localhost:80/index.php,PhpStorm不会在断点处停止,当访问外部IP时192.168.1.2/index.php,PhpStorm会遇到断点.
我想localhost用于调试而不是外部IP.
有没有办法让PhpStorm与之合作localhost?
PS Visual Studio Code适用于两种情况(因此我相信Xdebug和PhpStorm工作正常).
[xdebug]
zend_extension = /usr/local/Cellar/php56/5.6.29_5/lib/php/extensions/debug-non-zts-20131226/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_port=9000
xdebug.remote_autostart=1
xdebug.remote_connect_back=1
xdebug.idekey=vagrant
xdebug.remote_host=0.0.0.0
Run Code Online (Sandbox Code Playgroud)
试图将xdebug.remote_host设置为127.0.0.1和localhost,行为相同.
调试localhost:80时,xdebug日志显示:
Log opened at 2017-01-03 14:06:36
I: Checking remote connect back address.
I: Checking header 'HTTP_X_FORWARDED_FOR'.
I: Checking header 'REMOTE_ADDR'.
I: Remote address found, connecting to ::1:9000.
W: Creating socket for '::1:9000', poll success, but error: Operation now in progress (19).
E: Could not connect …Run Code Online (Sandbox Code Playgroud) 从 url 启动调试会话的正确查询参数是什么?
我无法使用浏览器扩展之一来打开调试会话,因为我想从 webhook 开始调试,我只是不知道添加到 webhook url 的正确查询。IDE 密钥是 PHPSTORM。
我和PECL安装XDebug的sudo pecl install xdebug,我得到:checking Check for supported PHP versions... configure: error: not supported. Need a PHP version >= 7.0.0 and < 7.3.0 (found 5.6.30)
我安装了自制的最新的PHP v7.2中,但PECL发现内置的PHP版本过时的MacOS,我怎样才能使PECL找到最新版本?
我试图在OS X 10.15上安装Xdebug并遇到以下问题:
/private/tmp/pear/install/xdebug/xdebug.c:25:10:致命错误:找不到“ php.h”文件
我试图解决这里描述的问题:在MacOs Mojave上安装xdebug-找不到'php.h'文件
不幸的是,在此目录中找不到头文件: /Library/Developer/CommandLineTools/Packages
有什么想法可以获取OS X 10.15的当前头文件吗?