PHP require_once() 中的致命错误 n
PHP fatal error in require_once() can n
我在其他目录中有一个 php 文件,我想使用它的一些数据,但是当我 require_once() 我看到该文件时此错误:
致命错误:require_once(): 在 E:\wamp\www\newmvc\index.php 第 20
行
newmvc 是我的根
我确定没有拼写错误并且我有文件。
$Controller="user";
$param=array();
$className=ucfirst($Controller)."Controller";
$controllerfilepath="/Controller/".$className;
require_once "$controllerfilepath";
我想你忘了为 class 文件名添加扩展名 .php
:
$controllerfilepath="/Controller/" . $className . ".php";
我在其他目录中有一个 php 文件,我想使用它的一些数据,但是当我 require_once() 我看到该文件时此错误:
致命错误:require_once(): 在 E:\wamp\www\newmvc\index.php 第 20
行newmvc 是我的根 我确定没有拼写错误并且我有文件。
$Controller="user";
$param=array();
$className=ucfirst($Controller)."Controller";
$controllerfilepath="/Controller/".$className;
require_once "$controllerfilepath";
我想你忘了为 class 文件名添加扩展名 .php
:
$controllerfilepath="/Controller/" . $className . ".php";