致命错误:调用文件中未定义的函数.php错误/定义的函数


Fatal error: Call to undefined function in file.php error / defined function

>我有一个2007年开发的网站。我一直在使用这个网站没有问题,但最近我遇到了如下所示的 php 错误:

Fatal error: Call to undefined function getTitle() in comments.php error on line 3
$ptitle = htmlspecialchars(getTitle($row_cs['id'])); // line 3

此函数在 funcs.php 文件中定义。

以下是我如何使用包含的文件;

索引.php

include 'funcs.php'
...
...
...
include 'comments.php'

函子.php

function getTitle($tid)
{
    $sql = mysql_query("select title from table where id = '".$tid."'");
    $title = mysql_fetch_row($sql);
    return $title[0];
}

我在评论中调用getTitle()方法.php。
我没有直接在评论中包括函数.php.php
这两个文件(funcs.php和注释.php)都包含在index.php中。我通常在注释.php文件中使用 funcs.php 方法。

为什么我最近收到此错误,这是服务器配置问题吗?

感谢您的帮助。

请使用单引号来包含文件。

include 'func.php';
include 'comments.php';