- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
首先,了解一些 xdebug 信息:
Xdebug installed: 2.2.0rc1
Server API: Apache 2.4 Handler Apache Lounge
Windows: yes - Compiler: MS VC9 - Architecture: x86
Zend Server: no
PHP Version: 5.4.0
Zend API nr: 220100525
PHP API nr: 20100525
Debug Build: no
Thread Safe Build: yes
Configuration File Path: C:\Windows
Configuration File: C:\Uniserver\UniServer\usr\local\php\php.ini
Extensions directory: C:\Uniserver\UniServer\usr\local\php\extensions
You're already running the latest Xdebug version
一切看起来都很好。这是我的 php.ini 的样子:
[Xdebug]
zend_extension=C:\Uniserver\UniServer\usr\local\php\extensions\php_xdebug-2.2.0RC1-5.4-vc9.dll
xdebug.remote_host=localhost
xdebug.remote_port=9123
xdebug.idekey=PHPSTORM
xdebug.remote_mode=req
xdebug.remote_handler=dbgp
xdebug.remote_enable=1
xdebug.remote_connect_back=0
xdebug.remote_autostart=0
xdebug.remote_log="C:\Uniserver\UniServer\usr\local\php\extensions\tmp\log.log"
xdebug.overload_var_dump=1
xdebug.trace_format=0
xdebug.show_exception_trace=0
xdebug.default_enable=0
现在,我将尝试使用 PhpStorm 进行调试。首先,我转到设置->PHP->服务器并添加:
Name: localhost
Host: localhost
Port: 8080
Debugger: Xdebug
(是的,我的网站在端口 8080 上运行,否则我会与我正在使用的其他软件发生冲突。)然后我创建一个新的运行/调试配置:
PHP Remote Debug
Name: local
Servers: localhost
Ide key(session id): PHPSTORM
我还使用这个工具创建了一个启动/停止调试书签:http://www.jetbrains.com/phpstorm/marklets/index.html
好的,一切看起来都准备好了,所以我点击了 PhpStorm 中的“调试”按钮。
我项目的主页位于 http://localhost:8080/Project/page/Home.php ,所以我导航到那里。页面加载。我点击书签栏中的开始按钮,重新加载,页面保持空白...
当我在项目中的 home.php 文件上添加断点并再次重新加载时,断点被击中了!我可以跨过、进入...显示所有值。这没有任何问题。但是当我遍历所有断点,或者点击恢复程序,并返回浏览器时,页面完全空白。 HTML 代码如下所示:
<html><head><style type="text/css"></style></head><body></body></html>
这是怎么回事?为什么我正在调试的页面没有呈现?跨过代码有效,正在执行所有 php 和 html,但最后我的浏览器中没有显示任何内容。我计划在位于文件/Project/class/Account.php 中的函数上使用 Xdebugger,但如果不按主页上的按钮我无法到达那里。
为什么不使用你说的 Xdebug 代理?这能解决什么问题吗?好吧,每当我尝试设置一个时,我都会收到此错误:
Xdebug 代理:无法连接到 'localhost:9123' 上的 xdebug 代理
即使我的 Xdebug 代理配置是正确的:
IDE key: PHPSTORM
Host: localhost
Port: 9123
谁能告诉我这是怎么回事?我真的需要这个调试器,因为某些功能由于某种原因无法正常工作,这让我发疯。我需要检查正在传递哪些变量以及它们发生了什么。
编辑
额外信息:当我完成所有代码时,我的调试器说:
Waiting for incoming connection with ide key 'PHPSTORM'
这可能是我的页面未加载的原因吗?
编辑编辑
好的,不用点击调试按钮,我也可以开始监听 PHP 调试连接。这也有效!我的断点被击中,我可以进入...但同样的问题仍然存在:我的网页保持空白,我的调试器最后说“已断开连接”。该问题在任何浏览器中都存在。
编辑编辑编辑
我在调试时发现了其他一些非常奇怪的东西......我可以很好地进入我的代码,直到我点击获取我的数据库实例的函数。数据库类如下所示:
class Database
{
private static $instance = null;
private static $conn;
private function __construct()
{
try {
self::$conn = new mysqli('localhost', 'root', 'root', 'database', '3308');
} catch (Exception $ex) {
$errorpager = new CustomPageGenerator();
$errorpager->generateErrorPage("Connection to database failed. Please try again later.");
}
}
public static function getInstance()
{
try {
if (self::$instance == null) {
self::$instance = new Database();
}
return self::$instance;
} catch (Exception $ex) {
$errorpager = new CustomPageGenerator();
$errorpager->generateErrorPage("Connection to database failed. Please try again later.");
return false;
}
}
public function query($sql)
{
try {
return self::$conn->query($sql);
} catch (Exception $ex) {
$errorpager = new CustomPageGenerator();
$errorpager->generateErrorPage("Connection to database failed. Please try again later.");
return false;
}
}
}
我感觉我的数据库类可能与此问题有关...每次我点击 getInstance() 函数时,调试都会突然停止,并且我在 Google Chrome 中收到 net::ERR_CONNECTION_RESET 错误。这可能是问题所在吗?
最佳答案
此问题已在 Xdebug 2.2.0RC2 中修复。请升级。
关于PhpStorm + Xdebug = 页面未加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10125216/
XDebug 无法打开远程调试文件 /var/log/xdebug/xdebug.log。 我尝试对文件 /var/log/xdebug/xdebug.log 授予 664 权限,但我现在所做的失败了
我正在尝试调试此代码: public function removeBlankLines() { $this->qp->find('br'); } // <-- break point
我正在尝试设置 Xdebug,因为我厌倦了使用 echoes 和 var_dumps。 我使用 Atom 作为我的 IDE 和 php-debug plugin . 我正在使用 laravel Hom
直到最近,我一直在用 PHP(通过 Notepad++)编写代码,并通过检查 IIS 中的日志进行调试(一定喜欢那个 Web 平台安装程序);从那时起,我决定更新到更高效的代码编写/测试环境,并在使用
当 XDebug 捕获错误时,是否可以在堆栈跟踪中显示文件的完整路径? 目前我刚刚得到这个: ../stack.php:47 但我宁愿看到这样的东西: C:\inetpub\wwwroot\mysit
xdebug ang php 的此消息的解决方法是什么? Xdebug: [Step Debug] Could not connect to debugging client. Tried: loca
PhpStorm 看不到 xdebug 但它已安装。在我的浏览器中 xdebug 工作正常。问题出在哪儿? 错误: Connection with 'xdebug' was not establish
昨天一切正常。今天我使用ctrl + F8添加断点并按ctrl + p,x d,不再有Xdebug Start Debugging(Launch Browser),只有Xdebug Start Deb
我有一个 OS-X 设置并使用 Netbeans IDE 进行 PHP 编程。我在以下路径中安装了 xdebug zend_extension="/Applications/MAMP/bin/php/
我无法让 XDebug 在 Windows 7 机器上与 PhpStorm 和 Vagrant 一起工作。我已经按照每个教程来让这个工作,但没有运气。 所以我试过的是: PhpStorm 始终监听调试
如果我通过设置xdebug.remote_enable=1来启用xdebug,apache服务器会变得非常慢;一旦我将设置更改为0,就正常了。 我在这里发现了同样的问题:XDebug really s
我已经搜索了很多关于 IntelliJ IDEA 12 和 xdebug.file_link_format 的信息。配置值。 我没有发现任何有用的东西...... 使用“idea”、“intellij
所以我试图让 sublime text 2 与 x-debug 一起运行我已经安装了 Kindari-SublimeXdebug 我有 wamp(我启用了 xdebug ) 这是 php.ini 配置
我对使用 Homebrew 不太熟悉,但我喜欢它。它是如此容易。我正在尝试安装 Xdebug。网络上的一些帖子说要这样做: brew install xdebug 但是这不起作用。我得到:错误,没有可
我用 High Sierra (10.13) 重新安装了我的 MacBook。它包含 Apache/2.4.27 和 PHP 7.1.7。 现在我想激活xdebug。请有人给我一些信息,该怎么做? 感
我不小心丢失了 /etc/php5/conf.d 文件夹中的 xdebug.ini 文件。当我尝试使用 apt-get 安装 xdebug 时,如何取回它,它给出如下注释。 Not replacing
我想在 Sublime Text 3 中更改 XDebug 插件的键绑定(bind)。如何更改 的键绑定(bind)运行 , 跳过 , 走进 , 走出 , ETC。? 最佳答案 这个答案更完整answ
当我写这条消息时浏览提示似乎这是一个棘手的问题,有各种补丁,但没有明确的答案......无论如何,我试试我的机会,就在这里。 我在 Ubuntu 10.04 上使用 Eclipse Helios PD
当我调试时,我想排除某些目录 - 例如,每次实例化一个类时,我的调试器都会进入 Doctrine 的 ClassLoader::loadClass() 这很烦人......我尝试添加那些我想排除的目录
我刚刚在OSX上安装了Xdebug v3.0.0beta1,并试图在PhpStorm 2020.1上使用它,但是我得到了: Xdebug: [Config] The setting 'xdebug.r
我是一名优秀的程序员,十分优秀!