php - php 中的调试器有问题(错误的错误行等)

标签 php ubuntu

我认为我的服务器闹鬼了。我在所有脚本上都运行了这个

ini_set('display_errors', 'On');
ini_set('html_errors', 0);

我在脚本 this.php 中遇到错误

Notice: Undefined index: filter in /(...)/this.php on line 217

第 217 行甚至不是来自被调用的函数...它是一个空行,其中没有任何内容。

有时我在完美的逻辑流条件下运行一些 echo(从某种意义上说它必须运行),但它们什么也没回显。有时他们会这样做。我刚刚评论了 mysqliquery 行,出于某种原因,他们继续查询并将内容保存到数据库中。我正在使用 ubuntu 的 native Connect to server 功能,但也在 filezilla 中尝试了这个并且它一直在发生。我知道文件正在保存。但是脚本似乎没有反应。这是我第一次面对这样的事情,真的很奇怪。我试过考虑所有事情,但没有什么令人满意的。重复/相似的函数名称、错误的指令、包含、文件缓冲区,但这一切似乎都在合理的标准之内。我不知道可能出了什么问题。有谁知道会发生什么?

场景:

通过 nodejs 运行 php。到目前为止,工作完美无瑕。

调用的 PHP 函数:脚本 one.php 中的 first()

一个.php:

include("this.php")

function first(){
    echo "This is echoed. This script works. I can remove and update this and line and it works well with the debugger"
    second(); //second is in this.php
}

这个.php:

functions second(){
     echo "THIS GETS NO ECHO, IT'S THE FIRST LINE IN SECOND()"

     global $mysqli;

     //filter as index is in line 183, 168, 170, 185, 190.
     //line 217 is completely out of this function bounds.

     $query = "some query"

     $mysqli->query($query); //I commented this. Still gets query...
}

我真的真的不明白会发生什么。我检查并仔细检查,只能假设这是文件缓冲区或其他问题,因为代码对我来说似乎是正确的...

编辑:

我刚刚从 this.php 中完全删除了 second()。代码运行时就好像什么都没发生一样...wtf...我在终端中运行了cat this.php。该代码似乎是最新的。它正在到达服务器...

最佳答案

我...我在不同的文件夹中有两个同名的不同脚本...我讨厌自己...

关于php - php 中的调试器有问题(错误的错误行等),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32352436/

相关文章:

php POSTstream_context_create 和 file_get_contents

php - 如何在mysql记录输出之间添加BR

python - AWS aws.push ImportError : No module named boto in Ubuntu

django - celery 文件夹在 Ubuntu 上的位置?

javascript - 确认离开 Wordpress 中的外部链接

javascript - jQuery 显示/隐藏点击错误

javascript - 如何增加按钮点击jquery的数值

python - celery :消费者:无法连接到 amqp://guest:**@127.0.0.1:5672//:[Errno 92] 协议(protocol)不可用

Ubuntu/Debian 如何识别设备的 USB 端口

c# - Ubuntu 19.10 上的 Unity3D,带有 vscode 和 C# 扩展 : get an error and the autocomplete doesn't working