【问题标题】:PHP Fatal error: Uncaught Error: Call to undefined functionPHP致命错误:未捕获的错误:调用未定义的函数
【发布时间】:2021-11-03 05:21:39
【问题描述】:

我最近从旧的 PHP5xx 迁移到 PHP7.4.23 版本,下面是测试 localhost URL 时的错误消息。我可以确认 index.php 已引用包含来自同一文件夹目标的 rightbar.php。如果我删除对 rightbar.php 的引用,那么该网站将完美加载。我不是编码员,但在这方面需要一些很大的帮助。 网站错误:`PHP致命错误:

未捕获的错误:调用未定义的函数 getResultBYkeyword() C:\inetpub\wwwroot\tamilmelisai\rightbar.php:169 堆栈跟踪: #0 C:\inetpub\wwwroot\tamilmelisai\index.php(28): 包含() #1 {main} 在第 169 行的 C:\inetpub\wwwroot\tamilmelisai\rightbar.php 中抛出`

rightbar.php第169行代码如下:

<?php $videoDetailstops = getResultBYkeyword("latest tamil trailers",3); if(count($videoDetailstops)):?>
                  

【问题讨论】:

  • 不确定是不是问题,但请检查:getResultBYkeyword 的大小写。 Y 是大写的。应该是getResultByKeyword
  • 谢谢伊万,还是同样的错误。应该是升级PHP的问题,看不懂命令。

标签: php fatal-error uncaught-reference-error


【解决方案1】:

经过大量试验和错误,以下是我制定的解决方案,即使我不是编码员。感谢所有查看查询并做出回应的人。 形成这样的:

<?php $videoDetailstops = getResultBYkeyword("latest tamil trailers",3); if(count($videoDetailstops)):?>

到这里:

<?php if (isset ($videoDetailstops) && $videoDetailstops = getResultBYkeyword("latest tamil trailers",3));?>

【讨论】:

  • call to undefined function 表示调用该函数的行不理解该函数是什么。这通常是由函数声明引起的(function getResultBYkeyword() {} 部分未包含在当前文件中。您的解决方案在这方面没有意义。一定是由您在调试时所做的其他修改引起的。
猜你喜欢
  • 2017-10-07
  • 1970-01-01
  • 2019-05-22
  • 2017-01-27
  • 2016-04-07
  • 2017-08-19
相关资源
最近更新 更多