我是php的新手,我正在开发一个2012年构建的网站,我正在尝试运行已编写的代码。我将数据库导入到我的本地phpmyadmin,并确保数据库连接正常工作后,我仍然收到require_once无法打开流警告,该网站无法正常工作。我希望有人能给我一个如何解决问题的想法。该程序不在我的kernel.php文件中的第二行代码之后运行。
require_once("framework/config.php");
require_once(CORE_PATH."DB.php");
require_once(CORE_PATH."template.php");
require_once(CORE_PATH."users.php");
DB.php文件如下所示,其中包含以下一些代码:
function DBConnect()
{
// if connection exists
if ( isset($this->DB) )
return $this->DB;
//made result
$result = @mysql_connect($this->dbHost, $this->dbUser, $this->dbPass);
// trow error if there is one
if ( !$result )
$this->trowCommon("DBConncect", $this->lang);
if (!@mysql_select_db($this->dbName))
$this->trowCommon("DBSelect", $this->lang);
// set link to DB connection
$this->DB = $result;
//set charset
$this->DBsetCharset();
return $this->DB;
}
function DBConnecti()
{
if ( isset($this->DB) )
return $this->DB;
$result = new mysqli($this->dbHost, $this->dbUser, $this->dbPass, $this->dbName);
if ( mysqli_connect_error() )
$this->trowCommon("DBConncect", $this->lang);
$this->DB = $result;
return $this->DB;
}